@haven-fi/solauto-sdk 1.0.281 → 1.0.282
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/transactions/transactionUtils.d.ts.map +1 -1
- package/dist/transactions/transactionUtils.js +5 -4
- package/dist/transactions/transactionsManager.d.ts.map +1 -1
- package/dist/transactions/transactionsManager.js +3 -0
- package/package.json +1 -1
- package/src/transactions/transactionUtils.ts +10 -4
- package/src/transactions/transactionsManager.ts +3 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transactionUtils.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAClB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,SAAS,EAA8B,MAAM,iBAAiB,CAAC;AAmBxE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAqCzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAOlD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"transactionUtils.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,kBAAkB,EAClB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,SAAS,EAA8B,MAAM,iBAAiB,CAAC;AAmBxE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAqCzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAOlD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAwLjD,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,EACtB,sBAAsB,EAAE,MAAM,EAAE,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAkH7B;AA2LD,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,GACrB,OAAO,CAAC,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CA0BnD;AAED,wBAAsB,8BAA8B,CAAC,MAAM,EAAE,aAAa,oBA2CzE;AAED,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,aAAa,EACrB,2BAA2B,CAAC,EAAE,MAAM,EACpC,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAsH5C;AAED,wBAAsB,gCAAgC,CACpD,eAAe,EAAE,oBAAoB,EACrC,YAAY,EAAE,SAAS,EACvB,eAAe,EAAE,SAAS,GACzB,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAsC5C;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,GAAG;;;;EA0DxE"}
|
@@ -53,10 +53,9 @@ async function transactionChoresBefore(client, accountsGettingCreated, solautoAc
|
|
53
53
|
let chores = (0, umi_1.transactionBuilder)();
|
54
54
|
if (client.referralStateData === null ||
|
55
55
|
(client.referredBy !== undefined &&
|
56
|
-
client.referralStateData
|
57
|
-
(0, umi_1.publicKey)(web3_js_1.PublicKey.default)) ||
|
56
|
+
(0, umi_web3js_adapters_1.toWeb3JsPublicKey)(client.referralStateData.referredByState).equals(web3_js_1.PublicKey.default)) ||
|
58
57
|
(client.authorityLutAddress !== undefined &&
|
59
|
-
|
58
|
+
(0, umi_web3js_adapters_1.toWeb3JsPublicKey)(client.referralStateData.lookupTable).equals(web3_js_1.PublicKey.default))) {
|
60
59
|
chores = chores.add(client.updateReferralStatesIx(undefined, client.authorityLutAddress));
|
61
60
|
}
|
62
61
|
if (client.selfManaged) {
|
@@ -440,7 +439,9 @@ function getErrorInfo(umi, tx, error) {
|
|
440
439
|
if (typeof error === "object" && error["InstructionError"]) {
|
441
440
|
const err = error["InstructionError"];
|
442
441
|
const errIx = tx.getInstructions()[Math.max(0, err[0])];
|
443
|
-
const errCode = typeof err[1] === "object" && "Custom" in err[1]
|
442
|
+
const errCode = typeof err[1] === "object" && "Custom" in err[1]
|
443
|
+
? err[1]["Custom"]
|
444
|
+
: undefined;
|
444
445
|
const errName = errCode === undefined ? err[1] : undefined;
|
445
446
|
let programName = "";
|
446
447
|
if (errIx.programId.toString() ===
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transactionsManager.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionsManager.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAMzD,OAAO,EACL,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,kBAAkB,EAElB,qBAAqB,EACrB,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,oBAAoB,EAAa,MAAM,YAAY,CAAC;AAO7D,qBAAa,wBAAyB,SAAQ,KAAK;gBACrC,OAAO,EAAE,MAAM;CAK5B;AAqCD,qBAAa,eAAe;IAMjB,OAAO,EAAE,CACd,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC;IACxC,IAAI,CAAC,EAAE,MAAM;IARtB,oBAAoB,EAAG,MAAM,EAAE,CAAC;IAChC,EAAE,CAAC,EAAE,kBAAkB,CAAC;IACjB,WAAW,EAAE,OAAO,CAAS;gBAG3B,OAAO,EAAE,CACd,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,EACxC,IAAI,CAAC,EAAE,MAAM,YAAA;IAGhB,UAAU;IAKV,OAAO,CAAC,UAAU,EAAE,MAAM;IAMhC,cAAc,IAAI,MAAM,EAAE;CAY3B;
|
1
|
+
{"version":3,"file":"transactionsManager.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionsManager.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,kBAAkB,EAEn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vB,OAAO,CAAC,MAAM,CAAC;IACf,OAAO,CAAC,kBAAkB;IAC1B,OAAO,CAAC,aAAa,CAAC;IACtB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,UAAU;IAVpB,OAAO,CAAC,QAAQ,CAAkC;IAClD,OAAO,CAAC,YAAY,CAAe;gBAGzB,SAAS,EAAE,aAAa,GAAG,oBAAoB,EAC/C,cAAc,CAAC,GAAE,CAAC,QAAQ,EAAE,0BAA0B,KAAK,IAAI,aAAA,EAC/D,MAAM,CAAC,EAAE,kBAAkB,YAAA,EAC3B,kBAAkB,GAAE,kBAA2C,EAC/D,aAAa,CAAC,EAAE,aAAa,YAAA,EAC7B,OAAO,GAAE,MAAU,EACnB,UAAU,GAAE,MAAY;YAQpB,uBAAuB;IAwCrC,OAAO,CAAC,YAAY;YA6CN,aAAa;IAoB3B,OAAO,CAAC,4BAA4B;IAUpC,OAAO,CAAC,mBAAmB;YAMb,SAAS;IAgBV,UAAU,CACrB,YAAY,EAAE,eAAe,EAAE,GAC9B,OAAO,CAAC,0BAA0B,CAAC;IA+DzB,IAAI,CACf,KAAK,EAAE,eAAe,EAAE,GACvB,OAAO,CAAC,0BAA0B,CAAC;YA+BxB,qBAAqB;YAuDrB,cAAc;YAqCd,eAAe;CAmD9B"}
|
@@ -105,7 +105,10 @@ class TransactionSet {
|
|
105
105
|
const transactions = this.items
|
106
106
|
.filter((x) => x.tx && x.tx.getInstructions().length > 0)
|
107
107
|
.map((x) => x.tx);
|
108
|
+
const txSpecificLuts = this.lutAddresses();
|
109
|
+
this.txHandler.log("Tx-specific LUTs: ", txSpecificLuts.map(x => x.toString()));
|
108
110
|
const lutInputs = await this.lookupTables.getLutInputs(this.lutAddresses());
|
111
|
+
this.txHandler.log("Lut inputs:", lutInputs);
|
109
112
|
return (0, umi_1.transactionBuilder)()
|
110
113
|
.add(transactions)
|
111
114
|
.setAddressLookupTables(lutInputs);
|
package/package.json
CHANGED
@@ -137,10 +137,13 @@ async function transactionChoresBefore(
|
|
137
137
|
if (
|
138
138
|
client.referralStateData === null ||
|
139
139
|
(client.referredBy !== undefined &&
|
140
|
-
client.referralStateData
|
141
|
-
|
140
|
+
toWeb3JsPublicKey(client.referralStateData!.referredByState).equals(
|
141
|
+
PublicKey.default
|
142
|
+
)) ||
|
142
143
|
(client.authorityLutAddress !== undefined &&
|
143
|
-
client.referralStateData!.lookupTable
|
144
|
+
toWeb3JsPublicKey(client.referralStateData!.lookupTable).equals(
|
145
|
+
PublicKey.default
|
146
|
+
))
|
144
147
|
) {
|
145
148
|
chores = chores.add(
|
146
149
|
client.updateReferralStatesIx(undefined, client.authorityLutAddress)
|
@@ -811,7 +814,10 @@ export function getErrorInfo(umi: Umi, tx: TransactionBuilder, error: any) {
|
|
811
814
|
if (typeof error === "object" && (error as any)["InstructionError"]) {
|
812
815
|
const err = (error as any)["InstructionError"];
|
813
816
|
const errIx = tx.getInstructions()[Math.max(0, err[0])];
|
814
|
-
const errCode =
|
817
|
+
const errCode =
|
818
|
+
typeof err[1] === "object" && "Custom" in err[1]
|
819
|
+
? err[1]["Custom"]
|
820
|
+
: undefined;
|
815
821
|
const errName = errCode === undefined ? (err[1] as string) : undefined;
|
816
822
|
let programName = "";
|
817
823
|
|
@@ -161,7 +161,10 @@ class TransactionSet {
|
|
161
161
|
.filter((x) => x.tx && x.tx.getInstructions().length > 0)
|
162
162
|
.map((x) => x.tx!);
|
163
163
|
|
164
|
+
const txSpecificLuts = this.lutAddresses();
|
165
|
+
this.txHandler.log("Tx-specific LUTs: ", txSpecificLuts.map(x => x.toString()));
|
164
166
|
const lutInputs = await this.lookupTables.getLutInputs(this.lutAddresses());
|
167
|
+
this.txHandler.log("Lut inputs:", lutInputs);
|
165
168
|
return transactionBuilder()
|
166
169
|
.add(transactions)
|
167
170
|
.setAddressLookupTables(lutInputs);
|