in /instructions/buy it returns data that's array of integer. In their docs it will be converted into buffer and consumed by message decoder.
When I try to do that in golang it doesn't work and failed to decode the data
Golang code:
data := responseTx.Tx.Data
buf := make([]byte, len(data))
for i, d := data {
buf[i] = byte(d)
}
tx, err := solana.TransactionFromDecoder(bin.NewBinDecoder(buf))
Input:
data = [1,0,9,20,225,137,187,132,187,32,147,173,43,163,223,65,131,162,193,42,192,159,17,212,162,207,219,137,175,244,246,208,43,32,154,238,143,142,48,46,229,90,171,138,102,8,144,82,192,134,88,49,12,189,138,222,113,61,218,218,181,24,242,189,61,99,136,65,196,242,164,172,136,81,180,154,105,86,217,232,114,177,80,218,126,68,36,219,232,7,97,66,21,150,26,150,175,68,196,177,102,193,1,248,66,21,84,90,171,143,66,175,82,152,249,58,137,57,190,200,137,220,64,181,8,198,51,6,96,38,138,225,255,21,35,174,141,211,83,149,162,153,19,218,231,60,186,70,34,169,74,45,147,70,248,106,120,29,192,83,198,44,4,174,6,65,215,207,111,121,182,215,225,243,94,74,34,197,254,6,58,219,44,150,187,27,196,166,160,240,71,217,227,180,139,14,12,158,58,228,224,183,152,74,250,18,157,96,7,160,158,224,142,150,46,161,202,218,73,218,230,18,50,147,194,191,195,125,8,175,246,228,16,89,36,102,175,155,72,107,229,118,121,242,246,139,65,205,220,49,224,32,146,119,74,143,99,98,237,19,100,86,96,93,8,145,61,224,5,62,188,181,150,48,71,56,229,110,39,39,82,37,99,189,75,58,132,117,251,109,190,41,110,63,77,30,236,241,173,15,85,172,25,39,211,100,236,45,65,196,249,149,133,127,65,57,58,215,199,190,66,39,49,131,147,224,252,92,124,240,210,8,192,184,182,228,87,89,35,144,23,73,35,197,120,36,50,169,143,71,179,207,36,212,146,159,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,195,27,24,204,62,20,138,10,82,147,129,137,32,237,250,237,171,57,30,73,51,108,11,116,219,102,157,16,71,3,66,75,145,66,174,215,146,153,82,142,79,92,42,195,58,12,218,147,137,182,146,105,58,9,209,230,235,134,206,164,17,28,156,212,246,133,86,151,50,106,40,222,250,246,5,67,6,18,251,213,239,142,84,131,191,154,252,251,23,226,204,42,247,89,214,15,6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169,6,167,213,23,25,44,92,81,33,140,201,76,61,74,241,127,88,218,238,8,155,161,253,68,227,219,217,138,0,0,0,0,140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89,0,11,227,225,235,161,122,71,63,137,176,247,232,226,73,64,242,10,235,142,188,167,26,136,253,233,93,75,131,183,26,9,5,33,159,137,154,129,212,255,132,251,89,61,46,223,138,144,172,27,58,179,66,88,247,223,35,62,165,3,2,177,189,46,223,64,67,143,181,25,82,110,138,69,12,221,5,93,218,23,254,247,227,114,53,49,75,129,202,98,7,63,109,177,26,78,3,19,6,0,11,1,7,12,11,17,242,35,198,137,82,225,242,182,254,128,40,4,156,77,0,0,0,19,12,0,11,13,14,1,7,12,2,7,15,11,16,34,102,6,61,18,1,218,235,234,255,254,128,40,4,156,77,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,22,0,3,11,4,13,14,1,5,7,12,6,2,7,8,7,15,11,17,18,16,9,10,42,37,74,217,157,79,49,35,6,254,250,128,40,4,156,77,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255]
https://api.magiceden.dev/#auth-info-82874536-9430-4dae-81dc-1235baaa3ef3
in /instructions/buy it returns data that's array of integer. In their docs it will be converted into buffer and consumed by message decoder.
When I try to do that in golang it doesn't work and failed to decode the data
Golang code:
Input:
Error Exception: