@streamflow/common 10.0.3 → 11.0.0-alpha.p334.45cbb4e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +984 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +2 -1
- package/dist/cjs/solana/index.cjs +984 -0
- package/dist/cjs/solana/index.cjs.map +1 -1
- package/dist/cjs/solana/index.d.cts +992 -1
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js +984 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/solana/index.d.ts +992 -1
- package/dist/esm/solana/index.js +984 -1
- package/dist/esm/solana/index.js.map +1 -1
- package/package.json +5 -4
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var splToken = require('@solana/spl-token');
|
|
4
4
|
var web3_js = require('@solana/web3.js');
|
|
5
5
|
var bs58 = require('bs58');
|
|
6
|
+
var anchor = require('@coral-xyz/anchor');
|
|
6
7
|
require('bn.js');
|
|
7
8
|
var buffer = require('buffer');
|
|
8
9
|
|
|
@@ -741,6 +742,985 @@ function assertHasPublicKey(value, message) {
|
|
|
741
742
|
invariant(value.publicKey, message);
|
|
742
743
|
}
|
|
743
744
|
|
|
745
|
+
// solana/descriptor/idl/partner_oracle.json
|
|
746
|
+
var partner_oracle_default = {
|
|
747
|
+
address: "pardpVtPjC8nLj1Dwncew62mUzfChdCX1EaoZe8oCAa",
|
|
748
|
+
metadata: {
|
|
749
|
+
name: "partner_oracle",
|
|
750
|
+
version: "1.0.0",
|
|
751
|
+
spec: "0.1.0",
|
|
752
|
+
description: "Created with Anchor"
|
|
753
|
+
},
|
|
754
|
+
instructions: [
|
|
755
|
+
{
|
|
756
|
+
name: "airdrop_clear_expired_fees",
|
|
757
|
+
discriminator: [
|
|
758
|
+
203,
|
|
759
|
+
5,
|
|
760
|
+
237,
|
|
761
|
+
235,
|
|
762
|
+
32,
|
|
763
|
+
38,
|
|
764
|
+
150,
|
|
765
|
+
235
|
|
766
|
+
],
|
|
767
|
+
accounts: [
|
|
768
|
+
{
|
|
769
|
+
name: "config",
|
|
770
|
+
docs: [
|
|
771
|
+
"Account that stores the config"
|
|
772
|
+
],
|
|
773
|
+
writable: true,
|
|
774
|
+
pda: {
|
|
775
|
+
seeds: [
|
|
776
|
+
{
|
|
777
|
+
kind: "const",
|
|
778
|
+
value: [
|
|
779
|
+
97,
|
|
780
|
+
105,
|
|
781
|
+
114,
|
|
782
|
+
100,
|
|
783
|
+
114,
|
|
784
|
+
111,
|
|
785
|
+
112,
|
|
786
|
+
95,
|
|
787
|
+
99,
|
|
788
|
+
111,
|
|
789
|
+
110,
|
|
790
|
+
102,
|
|
791
|
+
105,
|
|
792
|
+
103
|
|
793
|
+
]
|
|
794
|
+
}
|
|
795
|
+
]
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
],
|
|
799
|
+
args: []
|
|
800
|
+
},
|
|
801
|
+
{
|
|
802
|
+
name: "airdrop_get_fees",
|
|
803
|
+
discriminator: [
|
|
804
|
+
185,
|
|
805
|
+
20,
|
|
806
|
+
28,
|
|
807
|
+
207,
|
|
808
|
+
70,
|
|
809
|
+
243,
|
|
810
|
+
32,
|
|
811
|
+
62
|
|
812
|
+
],
|
|
813
|
+
accounts: [
|
|
814
|
+
{
|
|
815
|
+
name: "config",
|
|
816
|
+
docs: [
|
|
817
|
+
"Account that stores the config"
|
|
818
|
+
],
|
|
819
|
+
pda: {
|
|
820
|
+
seeds: [
|
|
821
|
+
{
|
|
822
|
+
kind: "const",
|
|
823
|
+
value: [
|
|
824
|
+
97,
|
|
825
|
+
105,
|
|
826
|
+
114,
|
|
827
|
+
100,
|
|
828
|
+
114,
|
|
829
|
+
111,
|
|
830
|
+
112,
|
|
831
|
+
95,
|
|
832
|
+
99,
|
|
833
|
+
111,
|
|
834
|
+
110,
|
|
835
|
+
102,
|
|
836
|
+
105,
|
|
837
|
+
103
|
|
838
|
+
]
|
|
839
|
+
}
|
|
840
|
+
]
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
],
|
|
844
|
+
args: [
|
|
845
|
+
{
|
|
846
|
+
name: "pubkey",
|
|
847
|
+
type: "pubkey"
|
|
848
|
+
}
|
|
849
|
+
],
|
|
850
|
+
returns: {
|
|
851
|
+
defined: {
|
|
852
|
+
name: "AirdropFees"
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
},
|
|
856
|
+
{
|
|
857
|
+
name: "airdrop_initialize_config",
|
|
858
|
+
discriminator: [
|
|
859
|
+
2,
|
|
860
|
+
110,
|
|
861
|
+
102,
|
|
862
|
+
10,
|
|
863
|
+
34,
|
|
864
|
+
83,
|
|
865
|
+
164,
|
|
866
|
+
55
|
|
867
|
+
],
|
|
868
|
+
accounts: [
|
|
869
|
+
{
|
|
870
|
+
name: "payer",
|
|
871
|
+
docs: [
|
|
872
|
+
"Account that will cover tx fees, can be anybody since the instruction is safe"
|
|
873
|
+
],
|
|
874
|
+
writable: true,
|
|
875
|
+
signer: true
|
|
876
|
+
},
|
|
877
|
+
{
|
|
878
|
+
name: "config",
|
|
879
|
+
writable: true,
|
|
880
|
+
pda: {
|
|
881
|
+
seeds: [
|
|
882
|
+
{
|
|
883
|
+
kind: "const",
|
|
884
|
+
value: [
|
|
885
|
+
97,
|
|
886
|
+
105,
|
|
887
|
+
114,
|
|
888
|
+
100,
|
|
889
|
+
114,
|
|
890
|
+
111,
|
|
891
|
+
112,
|
|
892
|
+
95,
|
|
893
|
+
99,
|
|
894
|
+
111,
|
|
895
|
+
110,
|
|
896
|
+
102,
|
|
897
|
+
105,
|
|
898
|
+
103
|
|
899
|
+
]
|
|
900
|
+
}
|
|
901
|
+
]
|
|
902
|
+
}
|
|
903
|
+
},
|
|
904
|
+
{
|
|
905
|
+
name: "system_program",
|
|
906
|
+
address: "11111111111111111111111111111111"
|
|
907
|
+
}
|
|
908
|
+
],
|
|
909
|
+
args: []
|
|
910
|
+
},
|
|
911
|
+
{
|
|
912
|
+
name: "airdrop_remove_fees",
|
|
913
|
+
discriminator: [
|
|
914
|
+
119,
|
|
915
|
+
246,
|
|
916
|
+
202,
|
|
917
|
+
91,
|
|
918
|
+
59,
|
|
919
|
+
94,
|
|
920
|
+
252,
|
|
921
|
+
239
|
|
922
|
+
],
|
|
923
|
+
accounts: [
|
|
924
|
+
{
|
|
925
|
+
name: "authority",
|
|
926
|
+
docs: [
|
|
927
|
+
"Fee Authority"
|
|
928
|
+
],
|
|
929
|
+
writable: true,
|
|
930
|
+
signer: true,
|
|
931
|
+
address: "CgdggophaMCFRP8gA1QjrZHsHaNQgByhBU7zoF5TpXF7"
|
|
932
|
+
},
|
|
933
|
+
{
|
|
934
|
+
name: "config",
|
|
935
|
+
docs: [
|
|
936
|
+
"Account that stores the config"
|
|
937
|
+
],
|
|
938
|
+
writable: true,
|
|
939
|
+
pda: {
|
|
940
|
+
seeds: [
|
|
941
|
+
{
|
|
942
|
+
kind: "const",
|
|
943
|
+
value: [
|
|
944
|
+
97,
|
|
945
|
+
105,
|
|
946
|
+
114,
|
|
947
|
+
100,
|
|
948
|
+
114,
|
|
949
|
+
111,
|
|
950
|
+
112,
|
|
951
|
+
95,
|
|
952
|
+
99,
|
|
953
|
+
111,
|
|
954
|
+
110,
|
|
955
|
+
102,
|
|
956
|
+
105,
|
|
957
|
+
103
|
|
958
|
+
]
|
|
959
|
+
}
|
|
960
|
+
]
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
],
|
|
964
|
+
args: [
|
|
965
|
+
{
|
|
966
|
+
name: "pubkey",
|
|
967
|
+
type: "pubkey"
|
|
968
|
+
}
|
|
969
|
+
]
|
|
970
|
+
},
|
|
971
|
+
{
|
|
972
|
+
name: "airdrop_write_default_fees",
|
|
973
|
+
discriminator: [
|
|
974
|
+
37,
|
|
975
|
+
104,
|
|
976
|
+
254,
|
|
977
|
+
202,
|
|
978
|
+
136,
|
|
979
|
+
124,
|
|
980
|
+
245,
|
|
981
|
+
94
|
|
982
|
+
],
|
|
983
|
+
accounts: [
|
|
984
|
+
{
|
|
985
|
+
name: "authority",
|
|
986
|
+
docs: [
|
|
987
|
+
"Fee Authority"
|
|
988
|
+
],
|
|
989
|
+
writable: true,
|
|
990
|
+
signer: true,
|
|
991
|
+
address: "CgdggophaMCFRP8gA1QjrZHsHaNQgByhBU7zoF5TpXF7"
|
|
992
|
+
},
|
|
993
|
+
{
|
|
994
|
+
name: "config",
|
|
995
|
+
docs: [
|
|
996
|
+
"Account that stores the config"
|
|
997
|
+
],
|
|
998
|
+
writable: true,
|
|
999
|
+
pda: {
|
|
1000
|
+
seeds: [
|
|
1001
|
+
{
|
|
1002
|
+
kind: "const",
|
|
1003
|
+
value: [
|
|
1004
|
+
97,
|
|
1005
|
+
105,
|
|
1006
|
+
114,
|
|
1007
|
+
100,
|
|
1008
|
+
114,
|
|
1009
|
+
111,
|
|
1010
|
+
112,
|
|
1011
|
+
95,
|
|
1012
|
+
99,
|
|
1013
|
+
111,
|
|
1014
|
+
110,
|
|
1015
|
+
102,
|
|
1016
|
+
105,
|
|
1017
|
+
103
|
|
1018
|
+
]
|
|
1019
|
+
}
|
|
1020
|
+
]
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
],
|
|
1024
|
+
args: [
|
|
1025
|
+
{
|
|
1026
|
+
name: "creation_fee",
|
|
1027
|
+
type: "u32"
|
|
1028
|
+
},
|
|
1029
|
+
{
|
|
1030
|
+
name: "price_oracle_fee",
|
|
1031
|
+
type: "u32"
|
|
1032
|
+
},
|
|
1033
|
+
{
|
|
1034
|
+
name: "claim_min_fee",
|
|
1035
|
+
type: "u32"
|
|
1036
|
+
},
|
|
1037
|
+
{
|
|
1038
|
+
name: "claim_max_fee",
|
|
1039
|
+
type: "u32"
|
|
1040
|
+
},
|
|
1041
|
+
{
|
|
1042
|
+
name: "allocation_factor",
|
|
1043
|
+
type: "f64"
|
|
1044
|
+
},
|
|
1045
|
+
{
|
|
1046
|
+
name: "clawback_token_fee_percent",
|
|
1047
|
+
type: "f64"
|
|
1048
|
+
}
|
|
1049
|
+
]
|
|
1050
|
+
},
|
|
1051
|
+
{
|
|
1052
|
+
name: "airdrop_write_fees",
|
|
1053
|
+
discriminator: [
|
|
1054
|
+
71,
|
|
1055
|
+
165,
|
|
1056
|
+
178,
|
|
1057
|
+
215,
|
|
1058
|
+
19,
|
|
1059
|
+
70,
|
|
1060
|
+
146,
|
|
1061
|
+
71
|
|
1062
|
+
],
|
|
1063
|
+
accounts: [
|
|
1064
|
+
{
|
|
1065
|
+
name: "authority",
|
|
1066
|
+
docs: [
|
|
1067
|
+
"Fee Authority"
|
|
1068
|
+
],
|
|
1069
|
+
writable: true,
|
|
1070
|
+
signer: true,
|
|
1071
|
+
address: "CgdggophaMCFRP8gA1QjrZHsHaNQgByhBU7zoF5TpXF7"
|
|
1072
|
+
},
|
|
1073
|
+
{
|
|
1074
|
+
name: "config",
|
|
1075
|
+
docs: [
|
|
1076
|
+
"Account that stores the config"
|
|
1077
|
+
],
|
|
1078
|
+
writable: true,
|
|
1079
|
+
pda: {
|
|
1080
|
+
seeds: [
|
|
1081
|
+
{
|
|
1082
|
+
kind: "const",
|
|
1083
|
+
value: [
|
|
1084
|
+
97,
|
|
1085
|
+
105,
|
|
1086
|
+
114,
|
|
1087
|
+
100,
|
|
1088
|
+
114,
|
|
1089
|
+
111,
|
|
1090
|
+
112,
|
|
1091
|
+
95,
|
|
1092
|
+
99,
|
|
1093
|
+
111,
|
|
1094
|
+
110,
|
|
1095
|
+
102,
|
|
1096
|
+
105,
|
|
1097
|
+
103
|
|
1098
|
+
]
|
|
1099
|
+
}
|
|
1100
|
+
]
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
],
|
|
1104
|
+
args: [
|
|
1105
|
+
{
|
|
1106
|
+
name: "pubkey",
|
|
1107
|
+
type: "pubkey"
|
|
1108
|
+
},
|
|
1109
|
+
{
|
|
1110
|
+
name: "creation_fee",
|
|
1111
|
+
type: "u32"
|
|
1112
|
+
},
|
|
1113
|
+
{
|
|
1114
|
+
name: "price_oracle_fee",
|
|
1115
|
+
type: "u32"
|
|
1116
|
+
},
|
|
1117
|
+
{
|
|
1118
|
+
name: "claim_min_fee",
|
|
1119
|
+
type: "u32"
|
|
1120
|
+
},
|
|
1121
|
+
{
|
|
1122
|
+
name: "claim_max_fee",
|
|
1123
|
+
type: "u32"
|
|
1124
|
+
},
|
|
1125
|
+
{
|
|
1126
|
+
name: "allocation_factor",
|
|
1127
|
+
type: "f64"
|
|
1128
|
+
},
|
|
1129
|
+
{
|
|
1130
|
+
name: "clawback_token_fee_percent",
|
|
1131
|
+
type: "f64"
|
|
1132
|
+
},
|
|
1133
|
+
{
|
|
1134
|
+
name: "expiry_ts",
|
|
1135
|
+
type: "u64"
|
|
1136
|
+
}
|
|
1137
|
+
]
|
|
1138
|
+
},
|
|
1139
|
+
{
|
|
1140
|
+
name: "vesting_get_fees",
|
|
1141
|
+
discriminator: [
|
|
1142
|
+
239,
|
|
1143
|
+
230,
|
|
1144
|
+
28,
|
|
1145
|
+
173,
|
|
1146
|
+
134,
|
|
1147
|
+
247,
|
|
1148
|
+
57,
|
|
1149
|
+
176
|
|
1150
|
+
],
|
|
1151
|
+
accounts: [
|
|
1152
|
+
{
|
|
1153
|
+
name: "partners",
|
|
1154
|
+
pda: {
|
|
1155
|
+
seeds: [
|
|
1156
|
+
{
|
|
1157
|
+
kind: "const",
|
|
1158
|
+
value: [
|
|
1159
|
+
115,
|
|
1160
|
+
116,
|
|
1161
|
+
114,
|
|
1162
|
+
109,
|
|
1163
|
+
95,
|
|
1164
|
+
102,
|
|
1165
|
+
101,
|
|
1166
|
+
101,
|
|
1167
|
+
115
|
|
1168
|
+
]
|
|
1169
|
+
}
|
|
1170
|
+
]
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
],
|
|
1174
|
+
args: [
|
|
1175
|
+
{
|
|
1176
|
+
name: "pubkey",
|
|
1177
|
+
type: "pubkey"
|
|
1178
|
+
}
|
|
1179
|
+
],
|
|
1180
|
+
returns: {
|
|
1181
|
+
defined: {
|
|
1182
|
+
name: "VestingFees"
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
},
|
|
1186
|
+
{
|
|
1187
|
+
name: "vesting_initialize_partners",
|
|
1188
|
+
discriminator: [
|
|
1189
|
+
205,
|
|
1190
|
+
170,
|
|
1191
|
+
148,
|
|
1192
|
+
219,
|
|
1193
|
+
143,
|
|
1194
|
+
38,
|
|
1195
|
+
77,
|
|
1196
|
+
196
|
|
1197
|
+
],
|
|
1198
|
+
accounts: [
|
|
1199
|
+
{
|
|
1200
|
+
name: "payer",
|
|
1201
|
+
docs: [
|
|
1202
|
+
"Account that will cover tx fees, can be anybody since the instruction is safe"
|
|
1203
|
+
],
|
|
1204
|
+
writable: true,
|
|
1205
|
+
signer: true
|
|
1206
|
+
},
|
|
1207
|
+
{
|
|
1208
|
+
name: "partners",
|
|
1209
|
+
writable: true,
|
|
1210
|
+
pda: {
|
|
1211
|
+
seeds: [
|
|
1212
|
+
{
|
|
1213
|
+
kind: "const",
|
|
1214
|
+
value: [
|
|
1215
|
+
115,
|
|
1216
|
+
116,
|
|
1217
|
+
114,
|
|
1218
|
+
109,
|
|
1219
|
+
95,
|
|
1220
|
+
102,
|
|
1221
|
+
101,
|
|
1222
|
+
101,
|
|
1223
|
+
115
|
|
1224
|
+
]
|
|
1225
|
+
}
|
|
1226
|
+
]
|
|
1227
|
+
}
|
|
1228
|
+
},
|
|
1229
|
+
{
|
|
1230
|
+
name: "system_program",
|
|
1231
|
+
address: "11111111111111111111111111111111"
|
|
1232
|
+
}
|
|
1233
|
+
],
|
|
1234
|
+
args: []
|
|
1235
|
+
},
|
|
1236
|
+
{
|
|
1237
|
+
name: "vesting_remove_fees",
|
|
1238
|
+
discriminator: [
|
|
1239
|
+
233,
|
|
1240
|
+
176,
|
|
1241
|
+
222,
|
|
1242
|
+
64,
|
|
1243
|
+
79,
|
|
1244
|
+
14,
|
|
1245
|
+
48,
|
|
1246
|
+
168
|
|
1247
|
+
],
|
|
1248
|
+
accounts: [
|
|
1249
|
+
{
|
|
1250
|
+
name: "authority",
|
|
1251
|
+
docs: [
|
|
1252
|
+
"Account that will cover tx fees, should be equal to creator if not is not expired"
|
|
1253
|
+
],
|
|
1254
|
+
writable: true,
|
|
1255
|
+
signer: true,
|
|
1256
|
+
address: "CgdggophaMCFRP8gA1QjrZHsHaNQgByhBU7zoF5TpXF7"
|
|
1257
|
+
},
|
|
1258
|
+
{
|
|
1259
|
+
name: "partners",
|
|
1260
|
+
writable: true,
|
|
1261
|
+
pda: {
|
|
1262
|
+
seeds: [
|
|
1263
|
+
{
|
|
1264
|
+
kind: "const",
|
|
1265
|
+
value: [
|
|
1266
|
+
115,
|
|
1267
|
+
116,
|
|
1268
|
+
114,
|
|
1269
|
+
109,
|
|
1270
|
+
95,
|
|
1271
|
+
102,
|
|
1272
|
+
101,
|
|
1273
|
+
101,
|
|
1274
|
+
115
|
|
1275
|
+
]
|
|
1276
|
+
}
|
|
1277
|
+
]
|
|
1278
|
+
}
|
|
1279
|
+
}
|
|
1280
|
+
],
|
|
1281
|
+
args: [
|
|
1282
|
+
{
|
|
1283
|
+
name: "pubkey",
|
|
1284
|
+
type: "pubkey"
|
|
1285
|
+
}
|
|
1286
|
+
]
|
|
1287
|
+
},
|
|
1288
|
+
{
|
|
1289
|
+
name: "vesting_write_default_fees",
|
|
1290
|
+
discriminator: [
|
|
1291
|
+
96,
|
|
1292
|
+
198,
|
|
1293
|
+
97,
|
|
1294
|
+
81,
|
|
1295
|
+
162,
|
|
1296
|
+
50,
|
|
1297
|
+
51,
|
|
1298
|
+
10
|
|
1299
|
+
],
|
|
1300
|
+
accounts: [
|
|
1301
|
+
{
|
|
1302
|
+
name: "authority",
|
|
1303
|
+
docs: [
|
|
1304
|
+
"Account that will cover tx fees, should be equal to creator if not is not expired"
|
|
1305
|
+
],
|
|
1306
|
+
writable: true,
|
|
1307
|
+
signer: true,
|
|
1308
|
+
address: "CgdggophaMCFRP8gA1QjrZHsHaNQgByhBU7zoF5TpXF7"
|
|
1309
|
+
},
|
|
1310
|
+
{
|
|
1311
|
+
name: "partners",
|
|
1312
|
+
writable: true,
|
|
1313
|
+
pda: {
|
|
1314
|
+
seeds: [
|
|
1315
|
+
{
|
|
1316
|
+
kind: "const",
|
|
1317
|
+
value: [
|
|
1318
|
+
115,
|
|
1319
|
+
116,
|
|
1320
|
+
114,
|
|
1321
|
+
109,
|
|
1322
|
+
95,
|
|
1323
|
+
102,
|
|
1324
|
+
101,
|
|
1325
|
+
101,
|
|
1326
|
+
115
|
|
1327
|
+
]
|
|
1328
|
+
}
|
|
1329
|
+
]
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
],
|
|
1333
|
+
args: [
|
|
1334
|
+
{
|
|
1335
|
+
name: "creation_fee",
|
|
1336
|
+
type: "u32"
|
|
1337
|
+
},
|
|
1338
|
+
{
|
|
1339
|
+
name: "auto_claim_fee",
|
|
1340
|
+
type: "u32"
|
|
1341
|
+
},
|
|
1342
|
+
{
|
|
1343
|
+
name: "token_fee_percent",
|
|
1344
|
+
type: "f32"
|
|
1345
|
+
}
|
|
1346
|
+
]
|
|
1347
|
+
},
|
|
1348
|
+
{
|
|
1349
|
+
name: "vesting_write_fees",
|
|
1350
|
+
discriminator: [
|
|
1351
|
+
251,
|
|
1352
|
+
24,
|
|
1353
|
+
6,
|
|
1354
|
+
241,
|
|
1355
|
+
182,
|
|
1356
|
+
56,
|
|
1357
|
+
93,
|
|
1358
|
+
100
|
|
1359
|
+
],
|
|
1360
|
+
accounts: [
|
|
1361
|
+
{
|
|
1362
|
+
name: "authority",
|
|
1363
|
+
docs: [
|
|
1364
|
+
"Account that will cover tx fees, should be equal to creator if not is not expired"
|
|
1365
|
+
],
|
|
1366
|
+
writable: true,
|
|
1367
|
+
signer: true,
|
|
1368
|
+
address: "CgdggophaMCFRP8gA1QjrZHsHaNQgByhBU7zoF5TpXF7"
|
|
1369
|
+
},
|
|
1370
|
+
{
|
|
1371
|
+
name: "partners",
|
|
1372
|
+
writable: true,
|
|
1373
|
+
pda: {
|
|
1374
|
+
seeds: [
|
|
1375
|
+
{
|
|
1376
|
+
kind: "const",
|
|
1377
|
+
value: [
|
|
1378
|
+
115,
|
|
1379
|
+
116,
|
|
1380
|
+
114,
|
|
1381
|
+
109,
|
|
1382
|
+
95,
|
|
1383
|
+
102,
|
|
1384
|
+
101,
|
|
1385
|
+
101,
|
|
1386
|
+
115
|
|
1387
|
+
]
|
|
1388
|
+
}
|
|
1389
|
+
]
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
],
|
|
1393
|
+
args: [
|
|
1394
|
+
{
|
|
1395
|
+
name: "pubkey",
|
|
1396
|
+
type: "pubkey"
|
|
1397
|
+
},
|
|
1398
|
+
{
|
|
1399
|
+
name: "creation_fee",
|
|
1400
|
+
type: "u32"
|
|
1401
|
+
},
|
|
1402
|
+
{
|
|
1403
|
+
name: "auto_claim_fee",
|
|
1404
|
+
type: "u32"
|
|
1405
|
+
},
|
|
1406
|
+
{
|
|
1407
|
+
name: "token_fee_percent",
|
|
1408
|
+
type: "f32"
|
|
1409
|
+
}
|
|
1410
|
+
]
|
|
1411
|
+
}
|
|
1412
|
+
],
|
|
1413
|
+
accounts: [
|
|
1414
|
+
{
|
|
1415
|
+
name: "AirdropConfig",
|
|
1416
|
+
discriminator: [
|
|
1417
|
+
194,
|
|
1418
|
+
149,
|
|
1419
|
+
223,
|
|
1420
|
+
142,
|
|
1421
|
+
42,
|
|
1422
|
+
98,
|
|
1423
|
+
128,
|
|
1424
|
+
16
|
|
1425
|
+
]
|
|
1426
|
+
}
|
|
1427
|
+
],
|
|
1428
|
+
errors: [
|
|
1429
|
+
{
|
|
1430
|
+
code: 6e3,
|
|
1431
|
+
name: "Unauthorized",
|
|
1432
|
+
msg: "Account is not authorized to execute this instruction"
|
|
1433
|
+
},
|
|
1434
|
+
{
|
|
1435
|
+
code: 6001,
|
|
1436
|
+
name: "ArithmeticError",
|
|
1437
|
+
msg: "Arithmetic Error (overflow/underflow)"
|
|
1438
|
+
},
|
|
1439
|
+
{
|
|
1440
|
+
code: 6100,
|
|
1441
|
+
name: "InvalidExpiry",
|
|
1442
|
+
msg: "Provided expiry ts is invalid"
|
|
1443
|
+
},
|
|
1444
|
+
{
|
|
1445
|
+
code: 6101,
|
|
1446
|
+
name: "NoExpiredFees",
|
|
1447
|
+
msg: "No expired fees found, transaction won't change the config"
|
|
1448
|
+
},
|
|
1449
|
+
{
|
|
1450
|
+
code: 6200,
|
|
1451
|
+
name: "InvalidVestingFee",
|
|
1452
|
+
msg: "Received invalid Vesting Fee configuration"
|
|
1453
|
+
},
|
|
1454
|
+
{
|
|
1455
|
+
code: 6300,
|
|
1456
|
+
name: "InvalidAirdropFee",
|
|
1457
|
+
msg: "Received invalid Airdrop Fee configuration"
|
|
1458
|
+
},
|
|
1459
|
+
{
|
|
1460
|
+
code: 6301,
|
|
1461
|
+
name: "AirdropConfigFull",
|
|
1462
|
+
msg: "Airdrop config is full, can not write fees"
|
|
1463
|
+
}
|
|
1464
|
+
],
|
|
1465
|
+
types: [
|
|
1466
|
+
{
|
|
1467
|
+
name: "AirdropConfig",
|
|
1468
|
+
serialization: "bytemuck",
|
|
1469
|
+
repr: {
|
|
1470
|
+
kind: "c"
|
|
1471
|
+
},
|
|
1472
|
+
type: {
|
|
1473
|
+
kind: "struct",
|
|
1474
|
+
fields: [
|
|
1475
|
+
{
|
|
1476
|
+
name: "version",
|
|
1477
|
+
type: "u32"
|
|
1478
|
+
},
|
|
1479
|
+
{
|
|
1480
|
+
name: "usd_multiplier",
|
|
1481
|
+
docs: [
|
|
1482
|
+
"Multiplier to apply when calculating ALL fees"
|
|
1483
|
+
],
|
|
1484
|
+
type: "f32"
|
|
1485
|
+
},
|
|
1486
|
+
{
|
|
1487
|
+
name: "solana_price",
|
|
1488
|
+
docs: [
|
|
1489
|
+
"Last solana price used"
|
|
1490
|
+
],
|
|
1491
|
+
type: "u64"
|
|
1492
|
+
},
|
|
1493
|
+
{
|
|
1494
|
+
name: "creation_fee",
|
|
1495
|
+
docs: [
|
|
1496
|
+
"Creation SOL fee"
|
|
1497
|
+
],
|
|
1498
|
+
type: "u32"
|
|
1499
|
+
},
|
|
1500
|
+
{
|
|
1501
|
+
name: "price_oracle_fee",
|
|
1502
|
+
docs: [
|
|
1503
|
+
"Fee for custom price oracle used in dynamic airdrops"
|
|
1504
|
+
],
|
|
1505
|
+
type: "u32"
|
|
1506
|
+
},
|
|
1507
|
+
{
|
|
1508
|
+
name: "claim_min_fee",
|
|
1509
|
+
docs: [
|
|
1510
|
+
"Dynamic claim fee in SOL, min"
|
|
1511
|
+
],
|
|
1512
|
+
type: "u32"
|
|
1513
|
+
},
|
|
1514
|
+
{
|
|
1515
|
+
name: "claim_max_fee",
|
|
1516
|
+
docs: [
|
|
1517
|
+
"Dynamic claim fee in SOL, max"
|
|
1518
|
+
],
|
|
1519
|
+
type: "u32"
|
|
1520
|
+
},
|
|
1521
|
+
{
|
|
1522
|
+
name: "allocation_factor",
|
|
1523
|
+
docs: [
|
|
1524
|
+
"Factor to multiple claimable SOL by when calculating fee"
|
|
1525
|
+
],
|
|
1526
|
+
type: "f64"
|
|
1527
|
+
},
|
|
1528
|
+
{
|
|
1529
|
+
name: "clawback_token_fee_percent",
|
|
1530
|
+
docs: [
|
|
1531
|
+
"Toke % fee on clawback"
|
|
1532
|
+
],
|
|
1533
|
+
type: "f64"
|
|
1534
|
+
},
|
|
1535
|
+
{
|
|
1536
|
+
name: "buffer",
|
|
1537
|
+
type: {
|
|
1538
|
+
array: [
|
|
1539
|
+
"u8",
|
|
1540
|
+
144
|
|
1541
|
+
]
|
|
1542
|
+
}
|
|
1543
|
+
},
|
|
1544
|
+
{
|
|
1545
|
+
name: "partners",
|
|
1546
|
+
type: {
|
|
1547
|
+
array: [
|
|
1548
|
+
{
|
|
1549
|
+
defined: {
|
|
1550
|
+
name: "AirdropPartner"
|
|
1551
|
+
}
|
|
1552
|
+
},
|
|
1553
|
+
100
|
|
1554
|
+
]
|
|
1555
|
+
}
|
|
1556
|
+
}
|
|
1557
|
+
]
|
|
1558
|
+
}
|
|
1559
|
+
},
|
|
1560
|
+
{
|
|
1561
|
+
name: "AirdropFees",
|
|
1562
|
+
type: {
|
|
1563
|
+
kind: "struct",
|
|
1564
|
+
fields: [
|
|
1565
|
+
{
|
|
1566
|
+
name: "pubkey",
|
|
1567
|
+
docs: [
|
|
1568
|
+
"Account for which the fees were configured"
|
|
1569
|
+
],
|
|
1570
|
+
type: "pubkey"
|
|
1571
|
+
},
|
|
1572
|
+
{
|
|
1573
|
+
name: "creation_fee",
|
|
1574
|
+
docs: [
|
|
1575
|
+
"Creation SOL fee"
|
|
1576
|
+
],
|
|
1577
|
+
type: "u32"
|
|
1578
|
+
},
|
|
1579
|
+
{
|
|
1580
|
+
name: "price_oracle_fee",
|
|
1581
|
+
docs: [
|
|
1582
|
+
"Fee for custom price oracle used in dynamic airdrops"
|
|
1583
|
+
],
|
|
1584
|
+
type: "u32"
|
|
1585
|
+
},
|
|
1586
|
+
{
|
|
1587
|
+
name: "claim_min_fee",
|
|
1588
|
+
docs: [
|
|
1589
|
+
"Dynamic claim fee in SOL, min"
|
|
1590
|
+
],
|
|
1591
|
+
type: "u32"
|
|
1592
|
+
},
|
|
1593
|
+
{
|
|
1594
|
+
name: "claim_max_fee",
|
|
1595
|
+
docs: [
|
|
1596
|
+
"Dynamic claim fee in SOL, max"
|
|
1597
|
+
],
|
|
1598
|
+
type: "u32"
|
|
1599
|
+
},
|
|
1600
|
+
{
|
|
1601
|
+
name: "allocation_factor",
|
|
1602
|
+
docs: [
|
|
1603
|
+
"Factor to multiple claimable SOL by when calculating fee"
|
|
1604
|
+
],
|
|
1605
|
+
type: "f64"
|
|
1606
|
+
},
|
|
1607
|
+
{
|
|
1608
|
+
name: "clawback_token_fee_percent",
|
|
1609
|
+
docs: [
|
|
1610
|
+
"Token % fee on clawback"
|
|
1611
|
+
],
|
|
1612
|
+
type: "f64"
|
|
1613
|
+
}
|
|
1614
|
+
]
|
|
1615
|
+
}
|
|
1616
|
+
},
|
|
1617
|
+
{
|
|
1618
|
+
name: "AirdropPartner",
|
|
1619
|
+
serialization: "bytemuck",
|
|
1620
|
+
repr: {
|
|
1621
|
+
kind: "c"
|
|
1622
|
+
},
|
|
1623
|
+
type: {
|
|
1624
|
+
kind: "struct",
|
|
1625
|
+
fields: [
|
|
1626
|
+
{
|
|
1627
|
+
name: "pubkey",
|
|
1628
|
+
docs: [
|
|
1629
|
+
"Pubkey of the partner"
|
|
1630
|
+
],
|
|
1631
|
+
type: "pubkey"
|
|
1632
|
+
},
|
|
1633
|
+
{
|
|
1634
|
+
name: "creation_fee",
|
|
1635
|
+
docs: [
|
|
1636
|
+
"Creation SOL fee"
|
|
1637
|
+
],
|
|
1638
|
+
type: "u32"
|
|
1639
|
+
},
|
|
1640
|
+
{
|
|
1641
|
+
name: "price_oracle_fee",
|
|
1642
|
+
docs: [
|
|
1643
|
+
"Fee for custom price oracle used in dynamic airdrops"
|
|
1644
|
+
],
|
|
1645
|
+
type: "u32"
|
|
1646
|
+
},
|
|
1647
|
+
{
|
|
1648
|
+
name: "claim_min_fee",
|
|
1649
|
+
docs: [
|
|
1650
|
+
"Dynamic claim fee in SOL, min"
|
|
1651
|
+
],
|
|
1652
|
+
type: "u32"
|
|
1653
|
+
},
|
|
1654
|
+
{
|
|
1655
|
+
name: "claim_max_fee",
|
|
1656
|
+
docs: [
|
|
1657
|
+
"Dynamic claim fee in SOL, max"
|
|
1658
|
+
],
|
|
1659
|
+
type: "u32"
|
|
1660
|
+
},
|
|
1661
|
+
{
|
|
1662
|
+
name: "allocation_factor",
|
|
1663
|
+
docs: [
|
|
1664
|
+
"Factor to multiple claimable SOL by when calculating fee"
|
|
1665
|
+
],
|
|
1666
|
+
type: "f64"
|
|
1667
|
+
},
|
|
1668
|
+
{
|
|
1669
|
+
name: "clawback_token_fee_percent",
|
|
1670
|
+
docs: [
|
|
1671
|
+
"Toke % fee on clawback"
|
|
1672
|
+
],
|
|
1673
|
+
type: "f64"
|
|
1674
|
+
},
|
|
1675
|
+
{
|
|
1676
|
+
name: "expiry_ts",
|
|
1677
|
+
docs: [
|
|
1678
|
+
"Time when fee configuration expires"
|
|
1679
|
+
],
|
|
1680
|
+
type: "u64"
|
|
1681
|
+
},
|
|
1682
|
+
{
|
|
1683
|
+
name: "buffer",
|
|
1684
|
+
docs: [
|
|
1685
|
+
"Buffer for additional fields"
|
|
1686
|
+
],
|
|
1687
|
+
type: {
|
|
1688
|
+
array: [
|
|
1689
|
+
"u8",
|
|
1690
|
+
16
|
|
1691
|
+
]
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
]
|
|
1695
|
+
}
|
|
1696
|
+
},
|
|
1697
|
+
{
|
|
1698
|
+
name: "VestingFees",
|
|
1699
|
+
type: {
|
|
1700
|
+
kind: "struct",
|
|
1701
|
+
fields: [
|
|
1702
|
+
{
|
|
1703
|
+
name: "pubkey",
|
|
1704
|
+
type: "pubkey"
|
|
1705
|
+
},
|
|
1706
|
+
{
|
|
1707
|
+
name: "creation_fee",
|
|
1708
|
+
type: "u32"
|
|
1709
|
+
},
|
|
1710
|
+
{
|
|
1711
|
+
name: "auto_claim_fee",
|
|
1712
|
+
type: "u32"
|
|
1713
|
+
},
|
|
1714
|
+
{
|
|
1715
|
+
name: "token_fee_percent",
|
|
1716
|
+
type: "f32"
|
|
1717
|
+
}
|
|
1718
|
+
]
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
]
|
|
1722
|
+
};
|
|
1723
|
+
|
|
744
1724
|
// solana/utils.ts
|
|
745
1725
|
var SIMULATE_TRIES = 3;
|
|
746
1726
|
var buildSendThrottler = (sendRate, sendInterval = 1e3) => {
|
|
@@ -1047,6 +2027,9 @@ async function getMultipleAccountsInfoBatched(connection, pubKeys, commitment) {
|
|
|
1047
2027
|
const results = await Promise.all(batches);
|
|
1048
2028
|
return results.flat();
|
|
1049
2029
|
}
|
|
2030
|
+
function buildPartnerOracle(connection) {
|
|
2031
|
+
return new anchor.Program(partner_oracle_default, { connection });
|
|
2032
|
+
}
|
|
1050
2033
|
function deserializeRawTransaction(serializedTx) {
|
|
1051
2034
|
const txBuffer = buffer.Buffer.from(serializedTx, "base64");
|
|
1052
2035
|
try {
|
|
@@ -1149,6 +2132,7 @@ exports.ICluster = ICluster;
|
|
|
1149
2132
|
exports.TransactionFailedError = TransactionFailedError;
|
|
1150
2133
|
exports.ata = ata;
|
|
1151
2134
|
exports.ataBatchExist = ataBatchExist;
|
|
2135
|
+
exports.buildPartnerOracle = buildPartnerOracle;
|
|
1152
2136
|
exports.buildSendThrottler = buildSendThrottler;
|
|
1153
2137
|
exports.checkOrCreateAtaBatch = checkOrCreateAtaBatch;
|
|
1154
2138
|
exports.confirmAndEnsureTransaction = confirmAndEnsureTransaction;
|