@ledgerhq/coin-solana 0.22.0-nightly.3 → 0.22.0
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/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +39 -15
- package/lib/__tests__/fixtures/helpers.fixture.d.ts +2 -0
- package/lib/__tests__/fixtures/helpers.fixture.d.ts.map +1 -1
- package/lib/__tests__/fixtures/helpers.fixture.js +25 -1
- package/lib/__tests__/fixtures/helpers.fixture.js.map +1 -1
- package/lib/__tests__/unit/hw-signMessage.unit.test.js +4 -4
- package/lib/__tests__/unit/hw-signMessage.unit.test.js.map +1 -1
- package/lib/buildTransaction.d.ts.map +1 -1
- package/lib/buildTransaction.js +17 -14
- package/lib/buildTransaction.js.map +1 -1
- package/lib/buildTransaction.test.d.ts +2 -0
- package/lib/buildTransaction.test.d.ts.map +1 -0
- package/lib/buildTransaction.test.js +54 -0
- package/lib/buildTransaction.test.js.map +1 -0
- package/lib/hw-signMessage.d.ts.map +1 -1
- package/lib/hw-signMessage.js +2 -1
- package/lib/hw-signMessage.js.map +1 -1
- package/lib/network/chain/instruction/stake/types.d.ts +4 -4
- package/lib/network/chain/instruction/system/types.d.ts +10 -10
- package/lib/prepareTransaction.d.ts.map +1 -1
- package/lib/prepareTransaction.js +69 -2
- package/lib/prepareTransaction.js.map +1 -1
- package/lib/prepareTransaction.test.d.ts +2 -0
- package/lib/prepareTransaction.test.d.ts.map +1 -0
- package/lib/prepareTransaction.test.js +94 -0
- package/lib/prepareTransaction.test.js.map +1 -0
- package/lib/signOperation.d.ts.map +1 -1
- package/lib/signOperation.js +2 -1
- package/lib/signOperation.js.map +1 -1
- package/lib/signOperation.test.d.ts +3 -0
- package/lib/signOperation.test.d.ts.map +1 -0
- package/lib/signOperation.test.js +139 -0
- package/lib/signOperation.test.js.map +1 -0
- package/lib/types.d.ts +1 -0
- package/lib/types.d.ts.map +1 -1
- package/lib-es/__tests__/fixtures/helpers.fixture.d.ts +2 -0
- package/lib-es/__tests__/fixtures/helpers.fixture.d.ts.map +1 -1
- package/lib-es/__tests__/fixtures/helpers.fixture.js +23 -0
- package/lib-es/__tests__/fixtures/helpers.fixture.js.map +1 -1
- package/lib-es/__tests__/unit/hw-signMessage.unit.test.js +4 -4
- package/lib-es/__tests__/unit/hw-signMessage.unit.test.js.map +1 -1
- package/lib-es/buildTransaction.d.ts.map +1 -1
- package/lib-es/buildTransaction.js +17 -14
- package/lib-es/buildTransaction.js.map +1 -1
- package/lib-es/buildTransaction.test.d.ts +2 -0
- package/lib-es/buildTransaction.test.d.ts.map +1 -0
- package/lib-es/buildTransaction.test.js +52 -0
- package/lib-es/buildTransaction.test.js.map +1 -0
- package/lib-es/hw-signMessage.d.ts.map +1 -1
- package/lib-es/hw-signMessage.js +2 -1
- package/lib-es/hw-signMessage.js.map +1 -1
- package/lib-es/network/chain/instruction/stake/types.d.ts +4 -4
- package/lib-es/network/chain/instruction/system/types.d.ts +10 -10
- package/lib-es/prepareTransaction.d.ts.map +1 -1
- package/lib-es/prepareTransaction.js +66 -2
- package/lib-es/prepareTransaction.js.map +1 -1
- package/lib-es/prepareTransaction.test.d.ts +2 -0
- package/lib-es/prepareTransaction.test.d.ts.map +1 -0
- package/lib-es/prepareTransaction.test.js +89 -0
- package/lib-es/prepareTransaction.test.js.map +1 -0
- package/lib-es/signOperation.d.ts.map +1 -1
- package/lib-es/signOperation.js +2 -1
- package/lib-es/signOperation.js.map +1 -1
- package/lib-es/signOperation.test.d.ts +3 -0
- package/lib-es/signOperation.test.d.ts.map +1 -0
- package/lib-es/signOperation.test.js +135 -0
- package/lib-es/signOperation.test.js.map +1 -0
- package/lib-es/types.d.ts +1 -0
- package/lib-es/types.d.ts.map +1 -1
- package/package.json +8 -7
- package/src/__tests__/fixtures/helpers.fixture.ts +25 -0
- package/src/__tests__/unit/hw-signMessage.unit.test.ts +6 -6
- package/src/buildTransaction.test.ts +97 -0
- package/src/buildTransaction.ts +17 -15
- package/src/hw-signMessage.ts +2 -1
- package/src/prepareTransaction.test.ts +133 -0
- package/src/prepareTransaction.ts +106 -1
- package/src/signOperation.test.ts +169 -0
- package/src/signOperation.ts +3 -1
- package/src/types.ts +1 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @ledgerhq/coin-solana@0.22.0
|
|
2
|
+
> @ledgerhq/coin-solana@0.22.0 build /home/runner/work/ledger-live/ledger-live/libs/coin-modules/coin-solana
|
|
3
3
|
> tsc --outDir lib --module commonjs --moduleResolution node10 && tsc -m ES6 --outDir lib-es
|
|
4
4
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,36 +1,60 @@
|
|
|
1
1
|
# @ledgerhq/coin-solana
|
|
2
2
|
|
|
3
|
-
## 0.22.0
|
|
3
|
+
## 0.22.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#10114](https://github.com/LedgerHQ/ledger-live/pull/10114) [`b976361`](https://github.com/LedgerHQ/ledger-live/commit/b97636178a7bc1b6f0d1acbbeccf51d843198a10) Thanks [@Justkant](https://github.com/Justkant)! - fix: solana sign off-chain message
|
|
8
|
+
|
|
9
|
+
- [#10153](https://github.com/LedgerHQ/ledger-live/pull/10153) [`3c515ee`](https://github.com/LedgerHQ/ledger-live/commit/3c515ee6f582e35d5722e445f0bb9a104e935917) Thanks [@Justkant](https://github.com/Justkant)! - fix: use base58 encoding for Solana signMessage signature
|
|
10
|
+
|
|
11
|
+
- [#10132](https://github.com/LedgerHQ/ledger-live/pull/10132) [`ce912b3`](https://github.com/LedgerHQ/ledger-live/commit/ce912b35437c1f71d1566fa010c309beeea01b03) Thanks [@qperrot](https://github.com/qperrot)! - Update commande if transaction is updated
|
|
12
|
+
|
|
13
|
+
- [#9873](https://github.com/LedgerHQ/ledger-live/pull/9873) [`1aa6339`](https://github.com/LedgerHQ/ledger-live/commit/1aa63397067accf265ed978748cd33d83bfa972e) Thanks [@Moustafa-Koterba](https://github.com/Moustafa-Koterba)! - support RAW tx for Solana
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
6
16
|
|
|
7
|
-
- Updated dependencies [[`a7ba19c`](https://github.com/LedgerHQ/ledger-live/commit/a7ba19cfa5a895572edfcf036a10d2af83efdf38)]:
|
|
8
|
-
- @ledgerhq/types-live@6.
|
|
9
|
-
- @ledgerhq/coin-framework@
|
|
17
|
+
- Updated dependencies [[`a7ba19c`](https://github.com/LedgerHQ/ledger-live/commit/a7ba19cfa5a895572edfcf036a10d2af83efdf38), [`91fe526`](https://github.com/LedgerHQ/ledger-live/commit/91fe526be2710f0fb18b4d035a5d8de630b3d4b5)]:
|
|
18
|
+
- @ledgerhq/types-live@6.70.0
|
|
19
|
+
- @ledgerhq/coin-framework@5.0.1
|
|
10
20
|
|
|
11
|
-
## 0.22.0-
|
|
21
|
+
## 0.22.0-next.0
|
|
12
22
|
|
|
13
23
|
### Minor Changes
|
|
14
24
|
|
|
15
25
|
- [#10114](https://github.com/LedgerHQ/ledger-live/pull/10114) [`b976361`](https://github.com/LedgerHQ/ledger-live/commit/b97636178a7bc1b6f0d1acbbeccf51d843198a10) Thanks [@Justkant](https://github.com/Justkant)! - fix: solana sign off-chain message
|
|
16
26
|
|
|
17
|
-
|
|
27
|
+
- [#10153](https://github.com/LedgerHQ/ledger-live/pull/10153) [`3c515ee`](https://github.com/LedgerHQ/ledger-live/commit/3c515ee6f582e35d5722e445f0bb9a104e935917) Thanks [@Justkant](https://github.com/Justkant)! - fix: use base58 encoding for Solana signMessage signature
|
|
28
|
+
|
|
29
|
+
- [#10132](https://github.com/LedgerHQ/ledger-live/pull/10132) [`ce912b3`](https://github.com/LedgerHQ/ledger-live/commit/ce912b35437c1f71d1566fa010c309beeea01b03) Thanks [@qperrot](https://github.com/qperrot)! - Update commande if transaction is updated
|
|
30
|
+
|
|
31
|
+
- [#9873](https://github.com/LedgerHQ/ledger-live/pull/9873) [`1aa6339`](https://github.com/LedgerHQ/ledger-live/commit/1aa63397067accf265ed978748cd33d83bfa972e) Thanks [@Moustafa-Koterba](https://github.com/Moustafa-Koterba)! - support RAW tx for Solana
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- Updated dependencies [[`a7ba19c`](https://github.com/LedgerHQ/ledger-live/commit/a7ba19cfa5a895572edfcf036a10d2af83efdf38), [`91fe526`](https://github.com/LedgerHQ/ledger-live/commit/91fe526be2710f0fb18b4d035a5d8de630b3d4b5)]:
|
|
36
|
+
- @ledgerhq/types-live@6.70.0-next.0
|
|
37
|
+
- @ledgerhq/coin-framework@5.0.1-next.0
|
|
38
|
+
|
|
39
|
+
## 0.21.1
|
|
18
40
|
|
|
19
41
|
### Patch Changes
|
|
20
42
|
|
|
21
|
-
- Updated dependencies [[`de92b67`](https://github.com/LedgerHQ/ledger-live/commit/de92b67ab9c8a553a817a245cecbfe292249d431)]:
|
|
22
|
-
- @ledgerhq/types-cryptoassets@7.23.0
|
|
23
|
-
- @ledgerhq/cryptoassets@13.16.0
|
|
24
|
-
- @ledgerhq/types-live@6.69.0
|
|
25
|
-
- @ledgerhq/coin-framework@
|
|
43
|
+
- Updated dependencies [[`de92b67`](https://github.com/LedgerHQ/ledger-live/commit/de92b67ab9c8a553a817a245cecbfe292249d431), [`b599ac4`](https://github.com/LedgerHQ/ledger-live/commit/b599ac4697688459aad15371f9efea58f331dc33), [`1d72da9`](https://github.com/LedgerHQ/ledger-live/commit/1d72da911a56d5b25fb6464e60ac236927823ce4)]:
|
|
44
|
+
- @ledgerhq/types-cryptoassets@7.23.0
|
|
45
|
+
- @ledgerhq/cryptoassets@13.16.0
|
|
46
|
+
- @ledgerhq/types-live@6.69.0
|
|
47
|
+
- @ledgerhq/coin-framework@5.0.0
|
|
26
48
|
|
|
27
|
-
## 0.21.1-
|
|
49
|
+
## 0.21.1-next.0
|
|
28
50
|
|
|
29
51
|
### Patch Changes
|
|
30
52
|
|
|
31
|
-
- Updated dependencies [[`1d72da9`](https://github.com/LedgerHQ/ledger-live/commit/1d72da911a56d5b25fb6464e60ac236927823ce4)]:
|
|
32
|
-
- @ledgerhq/types-
|
|
33
|
-
- @ledgerhq/
|
|
53
|
+
- Updated dependencies [[`de92b67`](https://github.com/LedgerHQ/ledger-live/commit/de92b67ab9c8a553a817a245cecbfe292249d431), [`b599ac4`](https://github.com/LedgerHQ/ledger-live/commit/b599ac4697688459aad15371f9efea58f331dc33), [`1d72da9`](https://github.com/LedgerHQ/ledger-live/commit/1d72da911a56d5b25fb6464e60ac236927823ce4)]:
|
|
54
|
+
- @ledgerhq/types-cryptoassets@7.23.0-next.0
|
|
55
|
+
- @ledgerhq/cryptoassets@13.16.0-next.0
|
|
56
|
+
- @ledgerhq/types-live@6.69.0-next.0
|
|
57
|
+
- @ledgerhq/coin-framework@5.0.0-next.0
|
|
34
58
|
|
|
35
59
|
## 0.21.0
|
|
36
60
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AccountInfo, ParsedAccountData, ParsedTransactionMeta, ParsedTransactionWithMeta, PublicKey } from "@solana/web3.js";
|
|
2
2
|
import BigNumber from "bignumber.js";
|
|
3
|
+
import { Transaction } from "../../types";
|
|
3
4
|
export declare function publicKeyOf(str: string): PublicKey;
|
|
4
5
|
export declare function parsedAccountInfo({ lamports, owner, program, info, executable, type, }: {
|
|
5
6
|
lamports?: number;
|
|
@@ -94,4 +95,5 @@ export declare function epochInfo({ epoch }: {
|
|
|
94
95
|
slotsInEpoch: number;
|
|
95
96
|
transactionCount: number;
|
|
96
97
|
};
|
|
98
|
+
export declare function transaction(raw?: string): Transaction;
|
|
97
99
|
//# sourceMappingURL=helpers.fixture.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.fixture.d.ts","sourceRoot":"","sources":["../../../src/__tests__/fixtures/helpers.fixture.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,SAAS,EACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,SAAS,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"helpers.fixture.d.ts","sourceRoot":"","sources":["../../../src/__tests__/fixtures/helpers.fixture.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,qBAAqB,EACrB,yBAAyB,EACzB,SAAS,EACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,SAAS,MAAM,cAAc,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI1C,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,aAEtC;AAED,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,KAAK,EACL,OAAO,EACP,IAAI,EACJ,UAAU,EACV,IAAI,GACL,EAAE;IACD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,GAAG,QAAQ,GAAG,WAAW,GAAG,gBAAgB,CAAC;IAC7D,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,SAAS,GAAG,WAAW,GAAG,cAAc,CAAC;CAChD,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAWjC;AAED,wBAAgB,eAAe,CAAC,EAC9B,aAAa,EACb,UAAU,EACV,UAAU,GACX,EAAE;IACD,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE;QACV,MAAM,EAAE,SAAS,CAAC;QAClB,UAAU,EAAE,SAAS,CAAC;KACvB,CAAC;IACF,UAAU,EAAE;QACV,eAAe,EAAE,MAAM,CAAC;QACxB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;CACH;;;;oBARW,SAAS;wBACL,SAAS;;;;;;;;;;;;;6BAGJ,MAAM;+BACJ,MAAM;mBAClB,MAAM;;;EAkBhB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,OAAO,GACR,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjF;;;;;;;IASA;AAED,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,QAAQ,GACT,EAAE;IACD,KAAK,CAAC,EAAE,aAAa,GAAG,eAAe,GAAG,QAAQ,CAAC;IACnD,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;;;;;;;;;;;EAgBA;AAED,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,IAAI,EACJ,SAAS,EACT,SAAS,GACV,EAAE;IACD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,qBAAqB,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB,GAAG,yBAAyB,CAU5B;AAED,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE;;;;;;;EASrD;AAED,wBAAgB,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,WAAW,CAsBrD"}
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.epochInfo = exports.parsedTransaction = exports.parsedTokenInfo = exports.parsedHistoryInfo = exports.parsedStakeInfo = exports.parsedAccountInfo = exports.publicKeyOf = void 0;
|
|
6
|
+
exports.transaction = exports.epochInfo = exports.parsedTransaction = exports.parsedTokenInfo = exports.parsedHistoryInfo = exports.parsedStakeInfo = exports.parsedAccountInfo = exports.publicKeyOf = void 0;
|
|
7
7
|
const web3_js_1 = require("@solana/web3.js");
|
|
8
8
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
9
9
|
const uuid_1 = require("uuid");
|
|
@@ -95,4 +95,28 @@ function epochInfo({ epoch }) {
|
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
exports.epochInfo = epochInfo;
|
|
98
|
+
function transaction(raw) {
|
|
99
|
+
return {
|
|
100
|
+
family: "solana",
|
|
101
|
+
amount: new bignumber_js_1.default(0),
|
|
102
|
+
recipient: "",
|
|
103
|
+
model: {
|
|
104
|
+
kind: "transfer",
|
|
105
|
+
uiState: {},
|
|
106
|
+
commandDescriptor: {
|
|
107
|
+
command: {
|
|
108
|
+
kind: "transfer", // any kind can work, just needed a value for the test
|
|
109
|
+
sender: "Hj69wRzkrFuf1Nby4yzPEFHdsmQdMoVYjvDKZSLjZFEp",
|
|
110
|
+
recipient: "DwRL6XkPAtM1bfuySJKZGn2t9WeG25RC39isAu2nwak4",
|
|
111
|
+
amount: 0,
|
|
112
|
+
},
|
|
113
|
+
fee: 0,
|
|
114
|
+
warnings: {},
|
|
115
|
+
errors: {},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
raw: raw ?? "",
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
exports.transaction = transaction;
|
|
98
122
|
//# sourceMappingURL=helpers.fixture.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.fixture.js","sourceRoot":"","sources":["../../../src/__tests__/fixtures/helpers.fixture.ts"],"names":[],"mappings":";;;;;;AAAA,6CAMyB;AACzB,gEAAqC;AACrC,+BAAqC;
|
|
1
|
+
{"version":3,"file":"helpers.fixture.js","sourceRoot":"","sources":["../../../src/__tests__/fixtures/helpers.fixture.ts"],"names":[],"mappings":";;;;;;AAAA,6CAMyB;AACzB,gEAAqC;AACrC,+BAAqC;AAGrC,MAAM,IAAI,GAAG,IAAA,SAAE,GAAE,CAAC;AAElB,SAAgB,WAAW,CAAC,GAAW;IACrC,OAAO,IAAI,mBAAS,CAAC,IAAA,YAAK,EAAC,IAAA,SAAE,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;AAC7C,CAAC;AAFD,kCAEC;AAED,SAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,KAAK,EACL,OAAO,EACP,IAAI,EACJ,UAAU,EACV,IAAI,GAQL;IACC,OAAO;QACL,UAAU,EAAE,UAAU,IAAI,KAAK;QAC/B,KAAK,EAAE,KAAK,IAAI,WAAW,CAAC,OAAO,CAAC;QACpC,QAAQ,EAAE,QAAQ,IAAI,EAAE;QACxB,IAAI,EAAE;YACJ,OAAO;YACP,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;YACtB,KAAK,EAAE,GAAG;SACX;KACF,CAAC;AACJ,CAAC;AAzBD,8CAyBC;AAED,SAAgB,eAAe,CAAC,EAC9B,aAAa,EACb,UAAU,EACV,UAAU,GAYX;IACC,OAAO;QACL,IAAI,EAAE;YACJ,iBAAiB,EAAE,IAAI,sBAAS,CAAC,KAAK,CAAC;YACvC,UAAU;YACV,MAAM,EAAE;gBACN,SAAS,EAAE,WAAW,CAAC,EAAE,CAAC;gBAC1B,KAAK,EAAE,CAAC;gBACR,aAAa,EAAE,CAAC;aACjB;SACF;QACD,KAAK,EAAE;YACL,eAAe,EAAE,aAAa;YAC9B,UAAU,EAAE,EAAE,GAAG,UAAU,EAAE,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,EAAE,kBAAkB,EAAE,IAAI,EAAE;SACrF;KACF,CAAC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AG,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG;QACnE,IAAI,EAAE,IAAI,IAAI,CAAC;QACf,IAAI,EAAE,IAAI,IAAI,IAAI;QAClB,WAAW,EAAE;YACX,UAAU,EAAE,CAAC,SAAS,CAAC;YACvB,OAAO,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE;SACpE;KACF,CAAC;AACJ,CAAC;AApBD,8CAoBC;AAED,SAAgB,SAAS,CAAC,EAAE,KAAK,EAAqB;IACpD,OAAO;QACL,YAAY,EAAE,MAAM;QACpB,WAAW,EAAE,MAAM;QACnB,KAAK;QACL,SAAS,EAAE,IAAI;QACf,YAAY,EAAE,IAAI;QAClB,gBAAgB,EAAE,QAAQ;KAC3B,CAAC;AACJ,CAAC;AATD,8BASC;AAED,SAAgB,WAAW,CAAC,GAAY;IACtC,OAAO;QACL,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,IAAI,sBAAS,CAAC,CAAC,CAAC;QACxB,SAAS,EAAE,EAAE;QACb,KAAK,EAAE;YACL,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,EAAE;YACX,iBAAiB,EAAE;gBACjB,OAAO,EAAE;oBACP,IAAI,EAAE,UAAU,EAAE,sDAAsD;oBACxE,MAAM,EAAE,8CAA8C;oBACtD,SAAS,EAAE,8CAA8C;oBACzD,MAAM,EAAE,CAAC;iBACV;gBACD,GAAG,EAAE,CAAC;gBACN,QAAQ,EAAE,EAAE;gBACZ,MAAM,EAAE,EAAE;aACX;SACF;QACD,GAAG,EAAE,GAAG,IAAI,EAAE;KACf,CAAC;AACJ,CAAC;AAtBD,kCAsBC"}
|
|
@@ -16,7 +16,7 @@ describe("Testing call to hardware off-chain sign message on Solana", () => {
|
|
|
16
16
|
it("should sign a message off-chain on hardware and return the generated signature", async () => {
|
|
17
17
|
const APP_VERSION = "1.8.2";
|
|
18
18
|
const SIGNATURE = "4gVuB1KsM58fb3vRpnDucwW4Vi6fVGA51QDQd9ARvx4GH5yYVDPzDnvzUbSJf3YLWWdsX7zCMSN9N1GMnTYwWiJf";
|
|
19
|
-
const
|
|
19
|
+
const BASE58_SIGNATURE = "RTCCo3j8Nx4FocNfEjPqTFgsDjxge5YR3tapEpbWVRgzbPcnTAYD54KiodwhVETwHYLLb5gVACSmrH8RN5ZMEhq7iH88mVb1peF3pDKRgJGZ3opDhonkc5Tj";
|
|
20
20
|
const getAppConfigurationMock = jest.fn(() => {
|
|
21
21
|
return Promise.resolve({
|
|
22
22
|
version: APP_VERSION,
|
|
@@ -39,14 +39,14 @@ describe("Testing call to hardware off-chain sign message on Solana", () => {
|
|
|
39
39
|
const messageHex = "54657374696E67206F6E20536F6C616E61";
|
|
40
40
|
const offchainMessage = "ff736f6c616e61206f6666636861696e00000000000000000000000000000000000000000000000000000000000000000000016b4a46c53959cac0eff146ab323053cfc503321adfd453a7c67c91a24be03235220035343635373337343639364536373230364636453230353336463643363136453631";
|
|
41
41
|
const result = await (0, hw_signMessage_1.signMessage)(signerContext)("", { freshAddressPath: accountFreshAddressPath, freshAddress }, { message: messageHex });
|
|
42
|
-
expect(result.signature).toEqual(
|
|
42
|
+
expect(result.signature).toEqual(BASE58_SIGNATURE);
|
|
43
43
|
expect(signMessageMock).toHaveBeenCalledTimes(1);
|
|
44
44
|
expect(signMessageMock).toHaveBeenCalledWith(accountFreshAddressPath, offchainMessage);
|
|
45
45
|
});
|
|
46
46
|
it("should sign a message off-chain on legacy hardware and return the generated signature", async () => {
|
|
47
47
|
const APP_VERSION = "1.7.1";
|
|
48
48
|
const SIGNATURE = "4gVuB1KsM58fb3vRpnDucwW4Vi6fVGA51QDQd9ARvx4GH5yYVDPzDnvzUbSJf3YLWWdsX7zCMSN9N1GMnTYwWiJf";
|
|
49
|
-
const
|
|
49
|
+
const BASE58_SIGNATURE = "RTCCo3j8Nx4FocNfEjPqTFgsDjxge5YR3tapEpbWVRgzbPcnTAYD54KiodwhVETwHYLLb5gVACSmrH8RN5ZMEhq7iH88mVb1peF3pDKRgJGZ3opDhonkc5Tj";
|
|
50
50
|
const getAppConfigurationMock = jest.fn(() => {
|
|
51
51
|
return Promise.resolve({
|
|
52
52
|
version: APP_VERSION,
|
|
@@ -69,7 +69,7 @@ describe("Testing call to hardware off-chain sign message on Solana", () => {
|
|
|
69
69
|
const messageHex = "54657374696E67206F6E20536F6C616E61";
|
|
70
70
|
const offchainMessage = "ff736f6c616e61206f6666636861696e0000220035343635373337343639364536373230364636453230353336463643363136453631";
|
|
71
71
|
const result = await (0, hw_signMessage_1.signMessage)(signerContext)("", { freshAddressPath: accountFreshAddressPath, freshAddress }, { message: messageHex });
|
|
72
|
-
expect(result.signature).toEqual(
|
|
72
|
+
expect(result.signature).toEqual(BASE58_SIGNATURE);
|
|
73
73
|
expect(signMessageMock).toHaveBeenCalledTimes(1);
|
|
74
74
|
expect(signMessageMock).toHaveBeenCalledWith(accountFreshAddressPath, offchainMessage);
|
|
75
75
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hw-signMessage.unit.test.js","sourceRoot":"","sources":["../../../src/__tests__/unit/hw-signMessage.unit.test.ts"],"names":[],"mappings":";;;;;AAEA,yDAAmD;AACnD,yCAA+D;AAC/D,0DAAsC;AAEtC,gBAAU,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC,CAAC;IAC9B,oBAAoB,EAAE,OAAO;IAC7B,cAAc,EAAE,CAAC;IACjB,gBAAgB,EAAE,KAAK;IACvB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;CAC3B,CAAC,CAAC,CAAC;AAEJ,QAAQ,CAAC,2DAA2D,EAAE,GAAG,EAAE;IACzE,EAAE,CAAC,gFAAgF,EAAE,KAAK,IAAI,EAAE;QAC9F,MAAM,WAAW,GAAG,OAAO,CAAC;QAC5B,MAAM,SAAS,GACb,0FAA0F,CAAC;QAE7F,MAAM,
|
|
1
|
+
{"version":3,"file":"hw-signMessage.unit.test.js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AAI,CAAC,EAAE,EAAE;SACvB,CAAC,CAAC;QAEL,MAAM,MAAM,CAAC,IAAA,4BAAW,EAAC,aAAa,CAAC,CAAC,EAAE,EAAE,EAAa,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CACzF,6EAA6E,CAC9E,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildTransaction.d.ts","sourceRoot":"","sources":["../src/buildTransaction.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,EAAW,WAAW,EAAE,MAAM,SAAS,CAAC;AAcpD,OAAO,EAEL,oBAAoB,IAAI,kBAAkB,EAG1C,8BAA8B,
|
|
1
|
+
{"version":3,"file":"buildTransaction.d.ts","sourceRoot":"","sources":["../src/buildTransaction.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,EAAW,WAAW,EAAE,MAAM,SAAS,CAAC;AAcpD,OAAO,EAEL,oBAAoB,IAAI,kBAAkB,EAG1C,8BAA8B,EAE/B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,eAAO,MAAM,uBAAuB,YACzB,MAAM,eACF,WAAW,OACnB,QAAQ;;;gBAKC,MAAM,KAAK,kBAAkB,EA2B5C,CAAC"}
|
package/lib/buildTransaction.js
CHANGED
|
@@ -5,23 +5,26 @@ const web3_1 = require("./network/chain/web3");
|
|
|
5
5
|
const utils_1 = require("./utils");
|
|
6
6
|
const web3_js_1 = require("@solana/web3.js");
|
|
7
7
|
const buildTransactionWithAPI = async (address, transaction, api) => {
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
const recentBlockhash = await api.getLatestBlockhash();
|
|
9
|
+
let web3SolanaTransaction;
|
|
10
|
+
if (transaction.raw) {
|
|
11
|
+
web3SolanaTransaction = web3_js_1.VersionedTransaction.deserialize(Buffer.from(transaction.raw, "base64"));
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
const instructions = await buildInstructions(api, transaction);
|
|
15
|
+
const transactionMessage = new web3_js_1.TransactionMessage({
|
|
16
|
+
payerKey: new web3_js_1.PublicKey(address),
|
|
17
|
+
recentBlockhash: recentBlockhash.blockhash,
|
|
18
|
+
instructions,
|
|
19
|
+
});
|
|
20
|
+
web3SolanaTransaction = new web3_js_1.VersionedTransaction(transactionMessage.compileToLegacyMessage());
|
|
21
|
+
}
|
|
19
22
|
return [
|
|
20
|
-
|
|
23
|
+
web3SolanaTransaction,
|
|
21
24
|
recentBlockhash,
|
|
22
25
|
(signature) => {
|
|
23
|
-
|
|
24
|
-
return
|
|
26
|
+
web3SolanaTransaction.addSignature(new web3_js_1.PublicKey(address), signature);
|
|
27
|
+
return web3SolanaTransaction;
|
|
25
28
|
},
|
|
26
29
|
];
|
|
27
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildTransaction.js","sourceRoot":"","sources":["../src/buildTransaction.ts"],"names":[],"mappings":";;;AACA,+CAW8B;AAC9B,mCAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"buildTransaction.js","sourceRoot":"","sources":["../src/buildTransaction.ts"],"names":[],"mappings":";;;AACA,+CAW8B;AAC9B,mCAA4C;AAC5C,6CAOyB;AAGlB,MAAM,uBAAuB,GAAG,KAAK,EAC1C,OAAe,EACf,WAAwB,EACxB,GAAa,EAOb,EAAE;IACF,MAAM,eAAe,GAAG,MAAM,GAAG,CAAC,kBAAkB,EAAE,CAAC;IAEvD,IAAI,qBAA2C,CAAC;IAChD,IAAI,WAAW,CAAC,GAAG,EAAE,CAAC;QACpB,qBAAqB,GAAG,8BAAkB,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,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B,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACjD,KAAK,gBAAgB;YACnB,OAAO,IAAA,qCAA8B,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACtD,KAAK,iBAAiB;YACpB,OAAO,IAAA,mDAA4C,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACpE,KAAK,eAAe;YAClB,OAAO,IAAA,0CAAmC,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAC3D,KAAK,cAAc;YACjB,OAAO,IAAA,yCAAkC,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAC1D,KAAK,qBAAqB;YACxB,OAAO,IAAA,0CAAmC,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAC3D,KAAK,gBAAgB;YACnB,OAAO,IAAA,qCAA8B,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACtD,KAAK,kBAAkB;YACrB,OAAO,IAAA,uCAAgC,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACxD,KAAK,gBAAgB;YACnB,OAAO,IAAA,qCAA8B,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACtD,KAAK,aAAa;YAChB,OAAO,IAAA,kCAA2B,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACnD;YACE,OAAO,IAAA,yBAAiB,EAAC,OAAO,CAAC,CAAC;IACtC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildTransaction.test.d.ts","sourceRoot":"","sources":["../src/buildTransaction.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
4
|
+
const buildTransaction_1 = require("./buildTransaction");
|
|
5
|
+
const helpers_fixture_1 = require("./__tests__/fixtures/helpers.fixture");
|
|
6
|
+
describe("Testing buildTransaction", () => {
|
|
7
|
+
const ADDRESS = "Hj69wRzkrFuf1Nby4yzPEFHdsmQdMoVYjvDKZSLjZFEp";
|
|
8
|
+
const BLOCKHASH = "DJRuRgQP3BeBNH8WVdF9cppBDj7pQNiVr4ZDnqupRtTC";
|
|
9
|
+
const LAST_VALID_BLOCK_HEIGHT = 1;
|
|
10
|
+
const SIGNATURE = Buffer.from("any random value");
|
|
11
|
+
afterEach(() => jest.clearAllMocks());
|
|
12
|
+
it("should decode raw transaction and use it when user provide it", async () => {
|
|
13
|
+
const expectedSolanaTransaction = {};
|
|
14
|
+
expectedSolanaTransaction.addSignature = jest.fn();
|
|
15
|
+
web3_js_1.VersionedTransaction.deserialize = jest.fn((_serializedTransaction) => expectedSolanaTransaction);
|
|
16
|
+
const rawTransaction = (0, helpers_fixture_1.transaction)("test");
|
|
17
|
+
const [solanaTransaction, recentBlockhash, addSignatureCallback] = await (0, buildTransaction_1.buildTransactionWithAPI)(ADDRESS, rawTransaction, api(BLOCKHASH, LAST_VALID_BLOCK_HEIGHT));
|
|
18
|
+
expect(solanaTransaction).toEqual(expectedSolanaTransaction);
|
|
19
|
+
expect(recentBlockhash).toEqual(expect.objectContaining({
|
|
20
|
+
blockhash: BLOCKHASH,
|
|
21
|
+
lastValidBlockHeight: LAST_VALID_BLOCK_HEIGHT,
|
|
22
|
+
}));
|
|
23
|
+
addSignatureCallback(SIGNATURE);
|
|
24
|
+
expect(expectedSolanaTransaction.addSignature).toHaveBeenCalledTimes(1);
|
|
25
|
+
expect(expectedSolanaTransaction.addSignature).toHaveBeenCalledWith(new web3_js_1.PublicKey(ADDRESS), SIGNATURE);
|
|
26
|
+
expect(web3_js_1.VersionedTransaction.deserialize).toHaveBeenCalledTimes(1);
|
|
27
|
+
expect(web3_js_1.VersionedTransaction.deserialize).toHaveBeenCalledWith(Buffer.from(rawTransaction.raw, "base64"));
|
|
28
|
+
});
|
|
29
|
+
it("should build the transaction when user does not provide raw", async () => {
|
|
30
|
+
web3_js_1.VersionedTransaction.deserialize = jest.fn((_serializedTransaction) => ({}));
|
|
31
|
+
const nonRawTransaction = (0, helpers_fixture_1.transaction)();
|
|
32
|
+
const [solanaTransaction, recentBlockhash, addSignatureCallback] = await (0, buildTransaction_1.buildTransactionWithAPI)(ADDRESS, nonRawTransaction, api(BLOCKHASH, LAST_VALID_BLOCK_HEIGHT));
|
|
33
|
+
expect(recentBlockhash).toEqual(expect.objectContaining({
|
|
34
|
+
blockhash: BLOCKHASH,
|
|
35
|
+
lastValidBlockHeight: LAST_VALID_BLOCK_HEIGHT,
|
|
36
|
+
}));
|
|
37
|
+
solanaTransaction.addSignature = jest.fn();
|
|
38
|
+
addSignatureCallback(SIGNATURE);
|
|
39
|
+
expect(solanaTransaction.addSignature).toHaveBeenCalledTimes(1);
|
|
40
|
+
expect(solanaTransaction.addSignature).toHaveBeenCalledWith(new web3_js_1.PublicKey(ADDRESS), SIGNATURE);
|
|
41
|
+
expect(web3_js_1.VersionedTransaction.deserialize).toHaveBeenCalledTimes(0);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
function api(blockhash, lastValidBlockHeight) {
|
|
45
|
+
return {
|
|
46
|
+
getLatestBlockhash: () => Promise.resolve({
|
|
47
|
+
blockhash: blockhash,
|
|
48
|
+
lastValidBlockHeight: lastValidBlockHeight,
|
|
49
|
+
}),
|
|
50
|
+
getSimulationComputeUnits: (_instructions, _payer) => null,
|
|
51
|
+
getRecentPrioritizationFees: (_accounts) => [],
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=buildTransaction.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildTransaction.test.js","sourceRoot":"","sources":["../src/buildTransaction.test.ts"],"names":[],"mappings":";;AAAA,6CAMyB;AACzB,yDAA6D;AAE7D,0EAAmE;AAEnE,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,MAAM,OAAO,GAAG,8CAA8C,CAAC;IAC/D,MAAM,SAAS,GA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EAAE,GAAG,EAAE,CACvB,OAAO,CAAC,OAAO,CAAC;YACd,SAAS,EAAE,SAAS;YACpB,oBAAoB,EAAE,oBAAoB;SACT,CAAC;QACtC,yBAAyB,EAAE,CAAC,aAA4C,EAAE,MAAiB,EAAE,EAAE,CAC7F,IAAI;QACN,2BAA2B,EAAE,CAAC,SAAmB,EAAE,EAAE,CAAC,EAAgC;KAChE,CAAC;AAC3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hw-signMessage.d.ts","sourceRoot":"","sources":["../src/hw-signMessage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"hw-signMessage.d.ts","sourceRoot":"","sources":["../src/hw-signMessage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAKxC,eAAO,MAAM,WAAW,kBACN,cAAc,YAAY,CAAC,gBAE/B,QAAQ,WACT,OAAO,kBACA,UAAU,KACzB,QAAQ;IACT,SAAS,EAAE,MAAM,CAAC;CACnB,CAmBA,CAAC"}
|
package/lib/hw-signMessage.js
CHANGED
|
@@ -7,6 +7,7 @@ exports.signMessage = void 0;
|
|
|
7
7
|
const semver_1 = __importDefault(require("semver"));
|
|
8
8
|
const format_1 = require("./offchainMessage/format");
|
|
9
9
|
const config_1 = __importDefault(require("./config"));
|
|
10
|
+
const bs58_1 = __importDefault(require("bs58"));
|
|
10
11
|
const signMessage = (signerContext) => async (deviceId, account, messageOptions) => {
|
|
11
12
|
const message = messageOptions.message;
|
|
12
13
|
if (!message || typeof message !== "string") {
|
|
@@ -17,7 +18,7 @@ const signMessage = (signerContext) => async (deviceId, account, messageOptions)
|
|
|
17
18
|
const isLegacy = semver_1.default.lt(version, config_1.default.getCoinConfig().legacyOCMSMaxVersion);
|
|
18
19
|
return signer.signMessage(account.freshAddressPath, (0, format_1.toOffChainMessage)(message, account.freshAddress, isLegacy).toString("hex"));
|
|
19
20
|
});
|
|
20
|
-
return { signature:
|
|
21
|
+
return { signature: bs58_1.default.encode(result.signature) };
|
|
21
22
|
};
|
|
22
23
|
exports.signMessage = signMessage;
|
|
23
24
|
//# sourceMappingURL=hw-signMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hw-signMessage.js","sourceRoot":"","sources":["../src/hw-signMessage.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAI5B,qDAA6D;AAC7D,sDAAkC;
|
|
1
|
+
{"version":3,"file":"hw-signMessage.js","sourceRoot":"","sources":["../src/hw-signMessage.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAI5B,qDAA6D;AAC7D,sDAAkC;AAClC,gDAAwB;AAEjB,MAAM,WAAW,GACtB,CAAC,aAA0C,EAAE,EAAE,CAC/C,KAAK,EACH,QAAkB,EAClB,OAAgB,EAChB,cAA0B,EAGzB,EAAE;IACH,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC;IACvC,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CACb,6EAA6E,CAC9E,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QAC1D,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,mBAAmB,EAAE,CAAC;QACvD,MAAM,QAAQ,GAAG,gBAAM,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAU,CAAC,aAAa,EAAE,CAAC,oBAAoB,CAAC,CAAC;QAErF,OAAO,MAAM,CAAC,WAAW,CACvB,OAAO,CAAC,gBAAgB,EACxB,IAAA,0BAAiB,EAAC,OAAO,EAAE,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAC3E,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,SAAS,EAAE,cAAI,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;AACtD,CAAC,CAAC;AA3BS,QAAA,WAAW,eA2BpB"}
|
|
@@ -54,10 +54,10 @@ export declare const AuthorizeInfo: import("superstruct").Struct<{
|
|
|
54
54
|
}>;
|
|
55
55
|
export type SplitInfo = Infer<typeof SplitInfo>;
|
|
56
56
|
export declare const SplitInfo: import("superstruct").Struct<{
|
|
57
|
+
lamports: number;
|
|
57
58
|
stakeAccount: import("@solana/web3.js").PublicKey;
|
|
58
59
|
stakeAuthority: import("@solana/web3.js").PublicKey;
|
|
59
60
|
newSplitAccount: import("@solana/web3.js").PublicKey;
|
|
60
|
-
lamports: number;
|
|
61
61
|
}, {
|
|
62
62
|
stakeAccount: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
63
63
|
stakeAuthority: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
@@ -66,9 +66,9 @@ export declare const SplitInfo: import("superstruct").Struct<{
|
|
|
66
66
|
}>;
|
|
67
67
|
export type WithdrawInfo = Infer<typeof WithdrawInfo>;
|
|
68
68
|
export declare const WithdrawInfo: import("superstruct").Struct<{
|
|
69
|
+
lamports: number;
|
|
69
70
|
destination: import("@solana/web3.js").PublicKey;
|
|
70
71
|
stakeAccount: import("@solana/web3.js").PublicKey;
|
|
71
|
-
lamports: number;
|
|
72
72
|
withdrawAuthority: import("@solana/web3.js").PublicKey;
|
|
73
73
|
}, {
|
|
74
74
|
stakeAccount: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
@@ -160,10 +160,10 @@ export declare const IX_STRUCTS: {
|
|
|
160
160
|
newAuthority: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
161
161
|
}>;
|
|
162
162
|
readonly split: import("superstruct").Struct<{
|
|
163
|
+
lamports: number;
|
|
163
164
|
stakeAccount: import("@solana/web3.js").PublicKey;
|
|
164
165
|
stakeAuthority: import("@solana/web3.js").PublicKey;
|
|
165
166
|
newSplitAccount: import("@solana/web3.js").PublicKey;
|
|
166
|
-
lamports: number;
|
|
167
167
|
}, {
|
|
168
168
|
stakeAccount: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
169
169
|
stakeAuthority: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
@@ -171,9 +171,9 @@ export declare const IX_STRUCTS: {
|
|
|
171
171
|
lamports: import("superstruct").Struct<number, null>;
|
|
172
172
|
}>;
|
|
173
173
|
readonly withdraw: import("superstruct").Struct<{
|
|
174
|
+
lamports: number;
|
|
174
175
|
destination: import("@solana/web3.js").PublicKey;
|
|
175
176
|
stakeAccount: import("@solana/web3.js").PublicKey;
|
|
176
|
-
lamports: number;
|
|
177
177
|
withdrawAuthority: import("@solana/web3.js").PublicKey;
|
|
178
178
|
}, {
|
|
179
179
|
stakeAccount: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
@@ -2,8 +2,8 @@ import { Infer } from "superstruct";
|
|
|
2
2
|
export type CreateAccountInfo = Infer<typeof CreateAccountInfo>;
|
|
3
3
|
export declare const CreateAccountInfo: import("superstruct").Struct<{
|
|
4
4
|
owner: import("@solana/web3.js").PublicKey;
|
|
5
|
-
source: import("@solana/web3.js").PublicKey;
|
|
6
5
|
lamports: number;
|
|
6
|
+
source: import("@solana/web3.js").PublicKey;
|
|
7
7
|
newAccount: import("@solana/web3.js").PublicKey;
|
|
8
8
|
space: number;
|
|
9
9
|
}, {
|
|
@@ -23,9 +23,9 @@ export declare const AssignInfo: import("superstruct").Struct<{
|
|
|
23
23
|
}>;
|
|
24
24
|
export type TransferInfo = Infer<typeof TransferInfo>;
|
|
25
25
|
export declare const TransferInfo: import("superstruct").Struct<{
|
|
26
|
+
lamports: number;
|
|
26
27
|
source: import("@solana/web3.js").PublicKey;
|
|
27
28
|
destination: import("@solana/web3.js").PublicKey;
|
|
28
|
-
lamports: number;
|
|
29
29
|
}, {
|
|
30
30
|
source: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
31
31
|
destination: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
@@ -35,9 +35,9 @@ export type CreateAccountWithSeedInfo = Infer<typeof CreateAccountWithSeedInfo>;
|
|
|
35
35
|
export declare const CreateAccountWithSeedInfo: import("superstruct").Struct<{
|
|
36
36
|
owner: import("@solana/web3.js").PublicKey;
|
|
37
37
|
seed: string;
|
|
38
|
+
lamports: number;
|
|
38
39
|
base: import("@solana/web3.js").PublicKey;
|
|
39
40
|
source: import("@solana/web3.js").PublicKey;
|
|
40
|
-
lamports: number;
|
|
41
41
|
newAccount: import("@solana/web3.js").PublicKey;
|
|
42
42
|
space: number;
|
|
43
43
|
}, {
|
|
@@ -59,8 +59,8 @@ export declare const AdvanceNonceInfo: import("superstruct").Struct<{
|
|
|
59
59
|
}>;
|
|
60
60
|
export type WithdrawNonceInfo = Infer<typeof WithdrawNonceInfo>;
|
|
61
61
|
export declare const WithdrawNonceInfo: import("superstruct").Struct<{
|
|
62
|
-
destination: import("@solana/web3.js").PublicKey;
|
|
63
62
|
lamports: number;
|
|
63
|
+
destination: import("@solana/web3.js").PublicKey;
|
|
64
64
|
nonceAccount: import("@solana/web3.js").PublicKey;
|
|
65
65
|
nonceAuthority: import("@solana/web3.js").PublicKey;
|
|
66
66
|
}, {
|
|
@@ -123,9 +123,9 @@ export declare const AssignWithSeedInfo: import("superstruct").Struct<{
|
|
|
123
123
|
}>;
|
|
124
124
|
export type TransferWithSeedInfo = Infer<typeof TransferWithSeedInfo>;
|
|
125
125
|
export declare const TransferWithSeedInfo: import("superstruct").Struct<{
|
|
126
|
+
lamports: number;
|
|
126
127
|
source: import("@solana/web3.js").PublicKey;
|
|
127
128
|
destination: import("@solana/web3.js").PublicKey;
|
|
128
|
-
lamports: number;
|
|
129
129
|
sourceBase: import("@solana/web3.js").PublicKey;
|
|
130
130
|
sourceSeed: string;
|
|
131
131
|
sourceOwner: import("@solana/web3.js").PublicKey;
|
|
@@ -155,8 +155,8 @@ export declare const SystemInstructionType: import("superstruct").Struct<"transf
|
|
|
155
155
|
export declare const IX_STRUCTS: {
|
|
156
156
|
createAccount: import("superstruct").Struct<{
|
|
157
157
|
owner: import("@solana/web3.js").PublicKey;
|
|
158
|
-
source: import("@solana/web3.js").PublicKey;
|
|
159
158
|
lamports: number;
|
|
159
|
+
source: import("@solana/web3.js").PublicKey;
|
|
160
160
|
newAccount: import("@solana/web3.js").PublicKey;
|
|
161
161
|
space: number;
|
|
162
162
|
}, {
|
|
@@ -169,9 +169,9 @@ export declare const IX_STRUCTS: {
|
|
|
169
169
|
createAccountWithSeed: import("superstruct").Struct<{
|
|
170
170
|
owner: import("@solana/web3.js").PublicKey;
|
|
171
171
|
seed: string;
|
|
172
|
+
lamports: number;
|
|
172
173
|
base: import("@solana/web3.js").PublicKey;
|
|
173
174
|
source: import("@solana/web3.js").PublicKey;
|
|
174
|
-
lamports: number;
|
|
175
175
|
newAccount: import("@solana/web3.js").PublicKey;
|
|
176
176
|
space: number;
|
|
177
177
|
}, {
|
|
@@ -222,9 +222,9 @@ export declare const IX_STRUCTS: {
|
|
|
222
222
|
owner: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
223
223
|
}>;
|
|
224
224
|
transfer: import("superstruct").Struct<{
|
|
225
|
+
lamports: number;
|
|
225
226
|
source: import("@solana/web3.js").PublicKey;
|
|
226
227
|
destination: import("@solana/web3.js").PublicKey;
|
|
227
|
-
lamports: number;
|
|
228
228
|
}, {
|
|
229
229
|
source: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
230
230
|
destination: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
@@ -238,8 +238,8 @@ export declare const IX_STRUCTS: {
|
|
|
238
238
|
nonceAuthority: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
239
239
|
}>;
|
|
240
240
|
withdrawNonce: import("superstruct").Struct<{
|
|
241
|
-
destination: import("@solana/web3.js").PublicKey;
|
|
242
241
|
lamports: number;
|
|
242
|
+
destination: import("@solana/web3.js").PublicKey;
|
|
243
243
|
nonceAccount: import("@solana/web3.js").PublicKey;
|
|
244
244
|
nonceAuthority: import("@solana/web3.js").PublicKey;
|
|
245
245
|
}, {
|
|
@@ -265,9 +265,9 @@ export declare const IX_STRUCTS: {
|
|
|
265
265
|
nonceAuthority: import("superstruct").Struct<import("@solana/web3.js").PublicKey, null>;
|
|
266
266
|
}>;
|
|
267
267
|
transferWithSeed: import("superstruct").Struct<{
|
|
268
|
+
lamports: number;
|
|
268
269
|
source: import("@solana/web3.js").PublicKey;
|
|
269
270
|
destination: import("@solana/web3.js").PublicKey;
|
|
270
|
-
lamports: number;
|
|
271
271
|
sourceBase: import("@solana/web3.js").PublicKey;
|
|
272
272
|
sourceSeed: string;
|
|
273
273
|
sourceOwner: import("@solana/web3.js").PublicKey;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepareTransaction.d.ts","sourceRoot":"","sources":["../src/prepareTransaction.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AA0CrC,OAAO,KAAK,EAEV,aAAa,EAeb,WAAW,EAIZ,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"prepareTransaction.d.ts","sourceRoot":"","sources":["../src/prepareTransaction.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AA0CrC,OAAO,KAAK,EAEV,aAAa,EAeb,WAAW,EAIZ,MAAM,SAAS,CAAC;AA0IjB,QAAA,MAAM,kBAAkB,gBACT,aAAa,MACtB,WAAW,OACV,QAAQ,KACZ,QAAQ,WAAW,CAmBrB,CAAC;AAw4BF,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|