@wormhole-foundation/sdk-definitions 0.1.3-beta.3 → 0.1.3-beta.5
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/README.md +51 -2
- package/dist/cjs/chain.d.ts +19 -18
- package/dist/cjs/chain.d.ts.map +1 -1
- package/dist/cjs/chain.js +46 -24
- package/dist/cjs/chain.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/layout-items/chain.d.ts +8 -4
- package/dist/cjs/layout-items/chain.d.ts.map +1 -1
- package/dist/cjs/layout-items/chain.js +4 -4
- package/dist/cjs/layout-items/chain.js.map +1 -1
- package/dist/cjs/payloads/bam.d.ts +187 -0
- package/dist/cjs/payloads/bam.d.ts.map +1 -0
- package/dist/cjs/payloads/bam.js +37 -0
- package/dist/cjs/payloads/bam.js.map +1 -0
- package/dist/cjs/payloads/governance.d.ts +252 -252
- package/dist/cjs/payloads/relayer.d.ts +10 -10
- package/dist/cjs/payloads/tokenBridge.d.ts +14 -14
- package/dist/cjs/platform.d.ts +14 -19
- package/dist/cjs/platform.d.ts.map +1 -1
- package/dist/cjs/protocols/cctp.d.ts +9 -0
- package/dist/cjs/protocols/cctp.d.ts.map +1 -1
- package/dist/cjs/protocols/cctp.js +10 -0
- package/dist/cjs/protocols/cctp.js.map +1 -1
- package/dist/cjs/protocols/core.d.ts +5 -0
- package/dist/cjs/protocols/core.d.ts.map +1 -1
- package/dist/cjs/protocols/core.js +5 -0
- package/dist/cjs/protocols/core.js.map +1 -1
- package/dist/cjs/protocols/tokenBridge.d.ts +9 -0
- package/dist/cjs/protocols/tokenBridge.d.ts.map +1 -1
- package/dist/cjs/protocols/tokenBridge.js +10 -1
- package/dist/cjs/protocols/tokenBridge.js.map +1 -1
- package/dist/cjs/rpc.d.ts +1 -9
- package/dist/cjs/rpc.d.ts.map +1 -1
- package/dist/cjs/testing/mocks/chain.d.ts +6 -5
- package/dist/cjs/testing/mocks/chain.d.ts.map +1 -1
- package/dist/cjs/testing/mocks/chain.js +9 -6
- package/dist/cjs/testing/mocks/chain.js.map +1 -1
- package/dist/cjs/testing/mocks/platform.d.ts +11 -4
- package/dist/cjs/testing/mocks/platform.d.ts.map +1 -1
- package/dist/cjs/testing/mocks/platform.js +27 -6
- package/dist/cjs/testing/mocks/platform.js.map +1 -1
- package/dist/cjs/types.d.ts +1 -1
- package/dist/cjs/vaa.d.ts +4 -4
- package/dist/esm/chain.d.ts +19 -18
- package/dist/esm/chain.d.ts.map +1 -1
- package/dist/esm/chain.js +46 -24
- package/dist/esm/chain.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/layout-items/chain.d.ts +8 -4
- package/dist/esm/layout-items/chain.d.ts.map +1 -1
- package/dist/esm/layout-items/chain.js +1 -1
- package/dist/esm/layout-items/chain.js.map +1 -1
- package/dist/esm/payloads/bam.d.ts +187 -0
- package/dist/esm/payloads/bam.d.ts.map +1 -0
- package/dist/esm/payloads/bam.js +34 -0
- package/dist/esm/payloads/bam.js.map +1 -0
- package/dist/esm/payloads/governance.d.ts +252 -252
- package/dist/esm/payloads/relayer.d.ts +10 -10
- package/dist/esm/payloads/tokenBridge.d.ts +14 -14
- package/dist/esm/platform.d.ts +14 -19
- package/dist/esm/platform.d.ts.map +1 -1
- package/dist/esm/protocols/cctp.d.ts +9 -0
- package/dist/esm/protocols/cctp.d.ts.map +1 -1
- package/dist/esm/protocols/cctp.js +7 -0
- package/dist/esm/protocols/cctp.js.map +1 -1
- package/dist/esm/protocols/core.d.ts +5 -0
- package/dist/esm/protocols/core.d.ts.map +1 -1
- package/dist/esm/protocols/core.js +3 -1
- package/dist/esm/protocols/core.js.map +1 -1
- package/dist/esm/protocols/tokenBridge.d.ts +9 -0
- package/dist/esm/protocols/tokenBridge.d.ts.map +1 -1
- package/dist/esm/protocols/tokenBridge.js +7 -0
- package/dist/esm/protocols/tokenBridge.js.map +1 -1
- package/dist/esm/rpc.d.ts +1 -9
- package/dist/esm/rpc.d.ts.map +1 -1
- package/dist/esm/testing/mocks/chain.d.ts +6 -5
- package/dist/esm/testing/mocks/chain.d.ts.map +1 -1
- package/dist/esm/testing/mocks/chain.js +9 -6
- package/dist/esm/testing/mocks/chain.js.map +1 -1
- package/dist/esm/testing/mocks/platform.d.ts +11 -4
- package/dist/esm/testing/mocks/platform.d.ts.map +1 -1
- package/dist/esm/testing/mocks/platform.js +27 -6
- package/dist/esm/testing/mocks/platform.js.map +1 -1
- package/dist/esm/types.d.ts +1 -1
- package/dist/esm/vaa.d.ts +4 -4
- package/package.json +1 -1
- package/src/chain.ts +76 -59
- package/src/index.ts +1 -0
- package/src/layout-items/chain.ts +1 -1
- package/src/payloads/bam.ts +66 -0
- package/src/platform.ts +29 -28
- package/src/protocols/cctp.ts +27 -0
- package/src/protocols/core.ts +13 -0
- package/src/protocols/tokenBridge.ts +43 -0
- package/src/rpc.ts +1 -15
- package/src/testing/mocks/chain.ts +17 -8
- package/src/testing/mocks/platform.ts +40 -13
- package/src/types.ts +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,52 @@
|
|
|
1
|
-
|
|
1
|
+
# Definitions SDK
|
|
2
|
+
|
|
3
|
+
Replaces these files from old sdk:
|
|
2
4
|
* vaa/parser
|
|
3
|
-
* mock
|
|
5
|
+
* mock
|
|
6
|
+
|
|
7
|
+
## VAA
|
|
8
|
+
|
|
9
|
+
### Deserialization
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
// decode VAA
|
|
13
|
+
const vaaBytes = Buffer.from(testCase.vaa, "base64");
|
|
14
|
+
// deserializes the base VAA details (emitterChain, emitterAddress, sequence, signatures, payload, hash, etc)
|
|
15
|
+
const parsed = deserialize("Uint8Array", new Uint8Array(vaaBytes));
|
|
16
|
+
// deserialize the payload, first argument denotes the type of payload
|
|
17
|
+
const deserialized = deserializePayload("BAMessage", parsed.payload);
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
#### Available payload types
|
|
21
|
+
|
|
22
|
+
Token Bridge:
|
|
23
|
+
- "AttestMeta"
|
|
24
|
+
- "Transfer"
|
|
25
|
+
- "TransferWithPayload
|
|
26
|
+
|
|
27
|
+
Generic Relayer:
|
|
28
|
+
- "DeliveryInstruction"
|
|
29
|
+
- "RedeliveryInstruction"
|
|
30
|
+
- "DeliveryOverride"
|
|
31
|
+
|
|
32
|
+
Governance
|
|
33
|
+
- "CoreBridgeUpgradeContract"
|
|
34
|
+
- "CoreBridgeGuardianSetUpgrade"
|
|
35
|
+
- "CoreBridgeSetMessageFee"
|
|
36
|
+
- "CoreBridgeTransferFees"
|
|
37
|
+
- "CoreBridgeRecoverChainId"
|
|
38
|
+
- "TokenBridgeRegisterChain"
|
|
39
|
+
- "TokenBridgeUpgradeContract"
|
|
40
|
+
- "TokenBridgeRecoverChainId"
|
|
41
|
+
- "NftBridgeRegisterChain"
|
|
42
|
+
- "NftBridgeUpgradeContract"
|
|
43
|
+
- "NftBridgeRecoverChainId"
|
|
44
|
+
- "RelayerRegisterChain"
|
|
45
|
+
- "RelayerUpgradeContract"
|
|
46
|
+
- "RelayerUpdateDefaultProvider"
|
|
47
|
+
|
|
48
|
+
Circle
|
|
49
|
+
- "CircleTransferRelay"
|
|
50
|
+
|
|
51
|
+
BAM
|
|
52
|
+
- "BAMessage"
|
package/dist/cjs/chain.d.ts
CHANGED
|
@@ -3,29 +3,30 @@ import { Platform } from "./platform";
|
|
|
3
3
|
import { RpcConnection } from "./rpc";
|
|
4
4
|
import { AutomaticTokenBridge, TokenBridge } from "./protocols/tokenBridge";
|
|
5
5
|
import { AutomaticCircleBridge, CircleBridge } from "./protocols/cctp";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
type OmitChainRpc<P extends PlatformName, F extends keyof Platform<P>> = _omitRpc<P, _omitChain<Platform<P>[F]>>;
|
|
9
|
-
type OmitRpc<P extends PlatformName, F extends keyof Platform<P>> = _omitRpc<P, Platform<P>[F]>;
|
|
10
|
-
type OmitChain<P extends PlatformName, F extends keyof Platform<P>> = _omitChain<Platform<P>[F]>;
|
|
6
|
+
import { SignedTx, TokenId } from "./types";
|
|
7
|
+
import { WormholeMessageId } from "./attestation";
|
|
11
8
|
export declare abstract class ChainContext<P extends PlatformName> {
|
|
12
|
-
readonly platform: Platform<P>;
|
|
13
9
|
readonly chain: ChainName;
|
|
10
|
+
protected rpc?: RpcConnection<P>;
|
|
14
11
|
protected tokenBridge?: TokenBridge<P>;
|
|
15
12
|
protected autoTokenBridge?: AutomaticTokenBridge<P>;
|
|
16
13
|
protected circleBridge?: CircleBridge<P>;
|
|
17
14
|
protected autoCircleBridge?: AutomaticCircleBridge<P>;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
15
|
+
abstract platform: Platform<P>;
|
|
16
|
+
constructor(chain: ChainName);
|
|
17
|
+
getRpc(): RpcConnection<P>;
|
|
18
|
+
getDecimals(token: TokenId | "native"): Promise<bigint>;
|
|
19
|
+
getBalance(walletAddr: string, token: TokenId | "native"): Promise<bigint | null>;
|
|
20
|
+
getCurrentBlock(): Promise<number>;
|
|
21
|
+
parseTransaction(txid: string): Promise<WormholeMessageId[]>;
|
|
22
|
+
sendWait(stxns: SignedTx): Promise<string[]>;
|
|
23
|
+
supportsTokenBridge: () => boolean;
|
|
24
|
+
getTokenBridge(): Promise<TokenBridge<P>>;
|
|
25
|
+
supportsAutomaticTokenBridge: () => boolean;
|
|
26
|
+
getAutomaticTokenBridge(): Promise<AutomaticTokenBridge<P>>;
|
|
27
|
+
supportsCircleBridge: () => boolean;
|
|
28
|
+
getCircleBridge(): Promise<CircleBridge<P>>;
|
|
29
|
+
supportsAutomaticCircleBridge: () => boolean;
|
|
30
|
+
getAutomaticCircleBridge(): Promise<AutomaticCircleBridge<P>>;
|
|
29
31
|
}
|
|
30
|
-
export {};
|
|
31
32
|
//# sourceMappingURL=chain.d.ts.map
|
package/dist/cjs/chain.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../src/chain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../src/chain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAUtC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGlD,8BAAsB,YAAY,CAAC,CAAC,SAAS,YAAY;IAU3C,QAAQ,CAAC,KAAK,EAAE,SAAS;IARrC,SAAS,CAAC,GAAG,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC;IACjC,SAAS,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACvC,SAAS,CAAC,eAAe,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC;IACpD,SAAS,CAAC,YAAY,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IACzC,SAAS,CAAC,gBAAgB,CAAC,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC;IAEtD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;gBAEV,KAAK,EAAE,SAAS;IAErC,MAAM,IAAI,aAAa,CAAC,CAAC,CAAC;IAMpB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC;IAKvD,UAAU,CACd,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,OAAO,GAAG,QAAQ,GACxB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IASnB,eAAe,IAAI,OAAO,CAAC,MAAM,CAAC;IAKlC,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IAK5D,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IASlD,mBAAmB,gBAA+C;IAC5D,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAW/C,4BAA4B,gBACqB;IAC3C,uBAAuB,IAAI,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;IAWjE,oBAAoB,gBAAgD;IAC9D,eAAe,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAWjD,6BAA6B,gBACqB;IAE5C,wBAAwB,IAAI,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;CASpE"}
|
package/dist/cjs/chain.js
CHANGED
|
@@ -1,62 +1,84 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ChainContext = void 0;
|
|
4
|
+
const cctp_1 = require("./protocols/cctp");
|
|
5
|
+
const tokenBridge_1 = require("./protocols/tokenBridge");
|
|
4
6
|
class ChainContext {
|
|
5
|
-
platform;
|
|
6
7
|
chain;
|
|
7
8
|
// Cached Protocol clients
|
|
9
|
+
rpc;
|
|
8
10
|
tokenBridge;
|
|
9
11
|
autoTokenBridge;
|
|
10
12
|
circleBridge;
|
|
11
13
|
autoCircleBridge;
|
|
12
|
-
constructor(
|
|
13
|
-
this.platform = platform;
|
|
14
|
+
constructor(chain) {
|
|
14
15
|
this.chain = chain;
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
getRpc() {
|
|
18
|
+
this.rpc = this.rpc ? this.rpc : this.platform.getRpc(this.chain);
|
|
19
|
+
return this.rpc;
|
|
20
|
+
}
|
|
21
|
+
// Get the number of decimals for a token
|
|
22
|
+
async getDecimals(token) {
|
|
18
23
|
return this.platform.getDecimals(this.chain, this.getRpc(), token);
|
|
19
|
-
}
|
|
20
|
-
|
|
24
|
+
}
|
|
25
|
+
// Get the balance of a token for a given address
|
|
26
|
+
async getBalance(walletAddr, token) {
|
|
21
27
|
return this.platform.getBalance(this.chain, this.getRpc(), walletAddr, token);
|
|
22
|
-
}
|
|
28
|
+
}
|
|
29
|
+
async getCurrentBlock() {
|
|
30
|
+
return this.platform.getCurrentBlock(this.getRpc());
|
|
31
|
+
}
|
|
23
32
|
// Get details about the transaction
|
|
24
|
-
parseTransaction
|
|
33
|
+
async parseTransaction(txid) {
|
|
25
34
|
return this.platform.parseTransaction(this.chain, this.getRpc(), txid);
|
|
26
|
-
}
|
|
35
|
+
}
|
|
27
36
|
// Send a transaction and wait for it to be confirmed
|
|
28
|
-
sendWait
|
|
37
|
+
async sendWait(stxns) {
|
|
29
38
|
return this.platform.sendWait(this.chain, this.getRpc(), stxns);
|
|
30
|
-
}
|
|
31
|
-
//
|
|
32
|
-
parseAddress = (address) => {
|
|
33
|
-
return this.platform.parseAddress(this.chain, address);
|
|
34
|
-
};
|
|
39
|
+
}
|
|
40
|
+
//
|
|
35
41
|
// protocols
|
|
36
|
-
|
|
42
|
+
//
|
|
43
|
+
//
|
|
44
|
+
supportsTokenBridge = () => (0, tokenBridge_1.supportsTokenBridge)(this.platform);
|
|
45
|
+
async getTokenBridge() {
|
|
46
|
+
if (!(0, tokenBridge_1.supportsTokenBridge)(this.platform))
|
|
47
|
+
throw new Error("Platform does not support TokenBridge");
|
|
37
48
|
this.tokenBridge = this.tokenBridge
|
|
38
49
|
? this.tokenBridge
|
|
39
50
|
: await this.platform.getTokenBridge(this.getRpc());
|
|
40
51
|
return this.tokenBridge;
|
|
41
|
-
}
|
|
42
|
-
|
|
52
|
+
}
|
|
53
|
+
supportsAutomaticTokenBridge = () => (0, tokenBridge_1.supportsAutomaticTokenBridge)(this.platform);
|
|
54
|
+
async getAutomaticTokenBridge() {
|
|
55
|
+
if (!(0, tokenBridge_1.supportsAutomaticTokenBridge)(this.platform))
|
|
56
|
+
throw new Error("Platform does not support AutomaticTokenBridge");
|
|
43
57
|
this.autoTokenBridge = this.autoTokenBridge
|
|
44
58
|
? this.autoTokenBridge
|
|
45
59
|
: await this.platform.getAutomaticTokenBridge(this.getRpc());
|
|
46
60
|
return this.autoTokenBridge;
|
|
47
|
-
}
|
|
48
|
-
|
|
61
|
+
}
|
|
62
|
+
//
|
|
63
|
+
supportsCircleBridge = () => (0, cctp_1.supportsCircleBridge)(this.platform);
|
|
64
|
+
async getCircleBridge() {
|
|
65
|
+
if (!(0, cctp_1.supportsCircleBridge)(this.platform))
|
|
66
|
+
throw new Error("Platform does not support CircleBridge");
|
|
49
67
|
this.circleBridge = this.circleBridge
|
|
50
68
|
? this.circleBridge
|
|
51
69
|
: await this.platform.getCircleBridge(this.getRpc());
|
|
52
70
|
return this.circleBridge;
|
|
53
|
-
}
|
|
54
|
-
|
|
71
|
+
}
|
|
72
|
+
//
|
|
73
|
+
supportsAutomaticCircleBridge = () => (0, cctp_1.supportsAutomaticCircleBridge)(this.platform);
|
|
74
|
+
async getAutomaticCircleBridge() {
|
|
75
|
+
if (!(0, cctp_1.supportsAutomaticCircleBridge)(this.platform))
|
|
76
|
+
throw new Error("Platform does not support AutomaticCircleBridge");
|
|
55
77
|
this.autoCircleBridge = this.autoCircleBridge
|
|
56
78
|
? this.autoCircleBridge
|
|
57
79
|
: await this.platform.getAutomaticCircleBridge(this.getRpc());
|
|
58
80
|
return this.autoCircleBridge;
|
|
59
|
-
}
|
|
81
|
+
}
|
|
60
82
|
}
|
|
61
83
|
exports.ChainContext = ChainContext;
|
|
62
84
|
//# sourceMappingURL=chain.js.map
|
package/dist/cjs/chain.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../src/chain.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../src/chain.ts"],"names":[],"mappings":";;;AAGA,2CAG0B;AAC1B,yDAGiC;AAQjC,MAAsB,YAAY;IAUX;IATrB,0BAA0B;IAChB,GAAG,CAAoB;IACvB,WAAW,CAAkB;IAC7B,eAAe,CAA2B;IAC1C,YAAY,CAAmB;IAC/B,gBAAgB,CAA4B;IAItD,YAAqB,KAAgB;QAAhB,UAAK,GAAL,KAAK,CAAW;IAAG,CAAC;IAEzC,MAAM;QACJ,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAClE,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAED,yCAAyC;IACzC,KAAK,CAAC,WAAW,CAAC,KAAyB;QACzC,OAAO,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,KAAK,CAAC,CAAC;IACrE,CAAC;IAED,iDAAiD;IACjD,KAAK,CAAC,UAAU,CACd,UAAkB,EAClB,KAAyB;QAEzB,OAAO,IAAI,CAAC,QAAQ,CAAC,UAAU,CAC7B,IAAI,CAAC,KAAK,EAC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AC,gBAAgB,CAAC;IAC/B,CAAC;CACF;AAvGD,oCAuGC"}
|
package/dist/cjs/index.d.ts
CHANGED
package/dist/cjs/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,wBAAwB,CAAC;AAChC,OAAO,gBAAgB,CAAC;AAExB,cAAc,WAAW,CAAC;AAC1B,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AAExB,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC;AAEjC,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC"}
|
package/dist/cjs/index.js
CHANGED
|
@@ -32,6 +32,7 @@ require("./payloads/connect");
|
|
|
32
32
|
require("./payloads/relayer");
|
|
33
33
|
require("./payloads/governance");
|
|
34
34
|
require("./payloads/tokenBridge");
|
|
35
|
+
require("./payloads/bam");
|
|
35
36
|
__exportStar(require("./address"), exports);
|
|
36
37
|
__exportStar(require("./universalAddress"), exports);
|
|
37
38
|
__exportStar(require("./unsignedTransaction"), exports);
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oCAAoC;AACpC,8BAA4B;AAC5B,8BAA4B;AAC5B,iCAA+B;AAC/B,kCAAgC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oCAAoC;AACpC,8BAA4B;AAC5B,8BAA4B;AAC5B,iCAA+B;AAC/B,kCAAgC;AAChC,0BAAwB;AAExB,4CAA0B;AAC1B,qDAAmC;AACnC,wDAAsC;AACtC,wCAAsB;AACtB,0CAAwB;AACxB,4CAA0B;AAC1B,6CAA2B;AAC3B,0CAAwB;AACxB,8CAA4B;AAC5B,8CAA4B;AAC5B,wCAAsB;AACtB,gDAA8B;AAC9B,0CAAwB;AAExB,mDAAiC;AACjC,0DAAwC;AACxC,mDAAiC;AAEjC,qDAAqC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
export declare const chainItemBase: {
|
|
2
|
+
readonly binary: "uint";
|
|
3
|
+
readonly size: 2;
|
|
4
|
+
};
|
|
1
5
|
type AllowNull<T, B extends boolean> = B extends true ? T | null : T;
|
|
2
|
-
export declare const chainItem: <C extends readonly ("Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "
|
|
6
|
+
export declare const chainItem: <C extends readonly ("Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia")[] = readonly ["Solana", "Ethereum", "Terra", "Bsc", "Polygon", "Avalanche", "Oasis", "Algorand", "Aurora", "Fantom", "Karura", "Acala", "Klaytn", "Celo", "Near", "Moonbeam", "Neon", "Terra2", "Injective", "Osmosis", "Sui", "Aptos", "Arbitrum", "Optimism", "Gnosis", "Pythnet", "Xpla", "Btc", "Base", "Sei", "Rootstock", "Wormchain", "Cosmoshub", "Evmos", "Kujira", "Sepolia"], N extends boolean = false>(opts?: {
|
|
3
7
|
allowedChains?: C | undefined;
|
|
4
8
|
allowNull?: N | undefined;
|
|
5
9
|
} | undefined) => {
|
|
@@ -10,14 +14,14 @@ export declare const chainItem: <C extends readonly ("Solana" | "Btc" | "Algoran
|
|
|
10
14
|
readonly binary: "uint";
|
|
11
15
|
readonly size: 2;
|
|
12
16
|
};
|
|
13
|
-
export declare const fixedChainItem: <C extends "Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "
|
|
17
|
+
export declare const fixedChainItem: <C extends "Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia">(chain: C) => {
|
|
14
18
|
readonly custom: {
|
|
15
19
|
to: C;
|
|
16
|
-
from: (C extends bigint | boolean | PropertyKey ? import("@wormhole-foundation/sdk-base").AssertType<C extends bigint ? `bigint(${C})` : C extends boolean ? `boolean(${C})` : C, PropertyKey> : never) extends "Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "
|
|
20
|
+
from: (C extends bigint | boolean | PropertyKey ? import("@wormhole-foundation/sdk-base").AssertType<C extends bigint ? `bigint(${C})` : C extends boolean ? `boolean(${C})` : C, PropertyKey> : never) extends "Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia" ? import("@wormhole-foundation/sdk-base").ObjectFromMappingEntries<readonly [readonly ["Solana", 1], readonly ["Ethereum", 2], readonly ["Terra", 3], readonly ["Bsc", 4], readonly ["Polygon", 5], readonly ["Avalanche", 6], readonly ["Oasis", 7], readonly ["Algorand", 8], readonly ["Aurora", 9], readonly ["Fantom", 10], readonly ["Karura", 11], readonly ["Acala", 12], readonly ["Klaytn", 13], readonly ["Celo", 14], readonly ["Near", 15], readonly ["Moonbeam", 16], readonly ["Neon", 17], readonly ["Terra2", 18], readonly ["Injective", 19], readonly ["Osmosis", 20], readonly ["Sui", 21], readonly ["Aptos", 22], readonly ["Arbitrum", 23], readonly ["Optimism", 24], readonly ["Gnosis", 25], readonly ["Pythnet", 26], readonly ["Xpla", 28], readonly ["Btc", 29], readonly ["Base", 30], readonly ["Sei", 32], readonly ["Rootstock", 33], readonly ["Wormchain", 3104], readonly ["Cosmoshub", 4000], readonly ["Evmos", 4001], readonly ["Kujira", 4002], readonly ["Sepolia", 10002]]>[("Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia") & (C extends bigint | boolean | PropertyKey ? import("@wormhole-foundation/sdk-base").AssertType<C extends bigint ? `bigint(${C})` : C extends boolean ? `boolean(${C})` : C, PropertyKey> : never)] extends {
|
|
17
21
|
[key: string]: unknown;
|
|
18
22
|
[key: number]: unknown;
|
|
19
23
|
[key: symbol]: unknown;
|
|
20
|
-
} ? import("@wormhole-foundation/sdk-base").ObjectFromMappingEntries<readonly [readonly ["Solana", 1], readonly ["Ethereum", 2], readonly ["Terra", 3], readonly ["Bsc", 4], readonly ["Polygon", 5], readonly ["Avalanche", 6], readonly ["Oasis", 7], readonly ["Algorand", 8], readonly ["Aurora", 9], readonly ["Fantom", 10], readonly ["Karura", 11], readonly ["Acala", 12], readonly ["Klaytn", 13], readonly ["Celo", 14], readonly ["Near", 15], readonly ["Moonbeam", 16], readonly ["Neon", 17], readonly ["Terra2", 18], readonly ["Injective", 19], readonly ["Osmosis", 20], readonly ["Sui", 21], readonly ["Aptos", 22], readonly ["Arbitrum", 23], readonly ["Optimism", 24], readonly ["Gnosis", 25], readonly ["Pythnet", 26], readonly ["Xpla", 28], readonly ["Btc", 29], readonly ["Base", 30], readonly ["Sei", 32], readonly ["Wormchain", 3104], readonly ["Sepolia", 10002]]>[("Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "
|
|
24
|
+
} ? import("@wormhole-foundation/sdk-base").ObjectFromMappingEntries<readonly [readonly ["Solana", 1], readonly ["Ethereum", 2], readonly ["Terra", 3], readonly ["Bsc", 4], readonly ["Polygon", 5], readonly ["Avalanche", 6], readonly ["Oasis", 7], readonly ["Algorand", 8], readonly ["Aurora", 9], readonly ["Fantom", 10], readonly ["Karura", 11], readonly ["Acala", 12], readonly ["Klaytn", 13], readonly ["Celo", 14], readonly ["Near", 15], readonly ["Moonbeam", 16], readonly ["Neon", 17], readonly ["Terra2", 18], readonly ["Injective", 19], readonly ["Osmosis", 20], readonly ["Sui", 21], readonly ["Aptos", 22], readonly ["Arbitrum", 23], readonly ["Optimism", 24], readonly ["Gnosis", 25], readonly ["Pythnet", 26], readonly ["Xpla", 28], readonly ["Btc", 29], readonly ["Base", 30], readonly ["Sei", 32], readonly ["Rootstock", 33], readonly ["Wormchain", 3104], readonly ["Cosmoshub", 4000], readonly ["Evmos", 4001], readonly ["Kujira", 4002], readonly ["Sepolia", 10002]]>[("Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia") & (C extends bigint | boolean | PropertyKey ? import("@wormhole-foundation/sdk-base").AssertType<C extends bigint ? `bigint(${C})` : C extends boolean ? `boolean(${C})` : C, PropertyKey> : never)] : import("@wormhole-foundation/sdk-base").ObjectFromMappingEntries<readonly [readonly ["Solana", 1], readonly ["Ethereum", 2], readonly ["Terra", 3], readonly ["Bsc", 4], readonly ["Polygon", 5], readonly ["Avalanche", 6], readonly ["Oasis", 7], readonly ["Algorand", 8], readonly ["Aurora", 9], readonly ["Fantom", 10], readonly ["Karura", 11], readonly ["Acala", 12], readonly ["Klaytn", 13], readonly ["Celo", 14], readonly ["Near", 15], readonly ["Moonbeam", 16], readonly ["Neon", 17], readonly ["Terra2", 18], readonly ["Injective", 19], readonly ["Osmosis", 20], readonly ["Sui", 21], readonly ["Aptos", 22], readonly ["Arbitrum", 23], readonly ["Optimism", 24], readonly ["Gnosis", 25], readonly ["Pythnet", 26], readonly ["Xpla", 28], readonly ["Btc", 29], readonly ["Base", 30], readonly ["Sei", 32], readonly ["Rootstock", 33], readonly ["Wormchain", 3104], readonly ["Cosmoshub", 4000], readonly ["Evmos", 4001], readonly ["Kujira", 4002], readonly ["Sepolia", 10002]]>[("Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia") & (C extends bigint | boolean | PropertyKey ? import("@wormhole-foundation/sdk-base").AssertType<C extends bigint ? `bigint(${C})` : C extends boolean ? `boolean(${C})` : C, PropertyKey> : never)] : never;
|
|
21
25
|
};
|
|
22
26
|
readonly binary: "uint";
|
|
23
27
|
readonly size: 2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../../src/layout-items/chain.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../../src/layout-items/chain.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,aAAa;;;CAAuC,CAAC;AAElE,KAAK,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,OAAO,IAAI,CAAC,SAAS,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC;AAErE,eAAO,MAAM,SAAS;;;;;kBAUN,MAAM;gDAmBsB,MAAM;;;;CAGE,CAAC;AAErD,eAAO,MAAM,cAAc;;;;;;;;;;;CAOyB,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fixedChainItem = exports.chainItem = void 0;
|
|
3
|
+
exports.fixedChainItem = exports.chainItem = exports.chainItemBase = void 0;
|
|
4
4
|
const sdk_base_1 = require("@wormhole-foundation/sdk-base");
|
|
5
|
-
|
|
5
|
+
exports.chainItemBase = { binary: "uint", size: 2 };
|
|
6
6
|
const chainItem = (opts) => ({
|
|
7
|
-
...chainItemBase,
|
|
7
|
+
...exports.chainItemBase,
|
|
8
8
|
custom: {
|
|
9
9
|
to: (val) => {
|
|
10
10
|
if (val === 0) {
|
|
@@ -23,7 +23,7 @@ const chainItem = (opts) => ({
|
|
|
23
23
|
});
|
|
24
24
|
exports.chainItem = chainItem;
|
|
25
25
|
const fixedChainItem = (chain) => ({
|
|
26
|
-
...chainItemBase,
|
|
26
|
+
...exports.chainItemBase,
|
|
27
27
|
custom: {
|
|
28
28
|
to: chain,
|
|
29
29
|
from: (0, sdk_base_1.chainToChainId)(chain),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../../src/layout-items/chain.ts"],"names":[],"mappings":";;;AAAA,4DASuC;
|
|
1
|
+
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../../src/layout-items/chain.ts"],"names":[],"mappings":";;;AAAA,4DASuC;AAE1B,QAAA,aAAa,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAW,CAAC;AAI3D,MAAM,SAAS,GAAG,CAGvB,IAGD,EAAE,EAAE,CACH,CAAC;IACC,GAAG,qBAAa;IAChB,MAAM,EAAE;QACN,EAAE,EAAE,CAAC,GAAW,EAA2B,EAAE;YAC3C,IAAI,GAAG,KAAK,CAAC,EAAE;gBACb,IAAI,CAAC,IAAI,EAAE,SAAS;oBAClB,MAAM,IAAI,KAAK,CACb,mDAAmD,CACpD,CAAC;gBAEJ,OAAO,IAA+B,CAAC;aACxC;YAED,MAAM,KAAK,GAAG,IAAA,yBAAc,EAAC,IAAA,oBAAS,EAAC,GAAG,CAAC,CAAC,CAAC;YAC7C,MAAM,aAAa,GAAG,IAAI,EAAE,aAAa,IAAI,iBAAM,CAAC;YACpD,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC;gBAChC,MAAM,IAAI,KAAK,CACb,SAAS,KAAK,0BAA0B,aAAa,EAAE,CACxD,CAAC;YAEJ,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,EAAE,CAAC,GAA4B,EAAU,EAAE,CAC7C,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,yBAAc,EAAC,GAAG,CAAC;KACoB;CACd,CAAC,CAAC;AAhCxC,QAAA,SAAS,aAgC+B;AAE9C,MAAM,cAAc,GAAG,CAAsB,KAAQ,EAAE,EAAE,CAC9D,CAAC;IACC,GAAG,qBAAa;IAChB,MAAM,EAAE;QACN,EAAE,EAAE,KAAK;QACT,IAAI,EAAE,IAAA,yBAAc,EAAC,KAAK,CAAC;KACS;CACS,CAAC,CAAC;AAPxC,QAAA,cAAc,kBAO0B"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { ShallowMapping } from "@wormhole-foundation/sdk-base";
|
|
2
|
+
export declare const bamPayloads: readonly [readonly ["BamMessage", readonly [{
|
|
3
|
+
readonly name: "magicByte";
|
|
4
|
+
readonly binary: "uint";
|
|
5
|
+
readonly size: 1;
|
|
6
|
+
readonly custom: 187;
|
|
7
|
+
readonly omit: true;
|
|
8
|
+
}, {
|
|
9
|
+
readonly name: "version";
|
|
10
|
+
readonly binary: "uint";
|
|
11
|
+
readonly size: 1;
|
|
12
|
+
readonly custom: 0;
|
|
13
|
+
readonly omit: true;
|
|
14
|
+
}, {
|
|
15
|
+
readonly name: "type";
|
|
16
|
+
readonly binary: "uint";
|
|
17
|
+
readonly size: 1;
|
|
18
|
+
readonly custom: 0;
|
|
19
|
+
readonly omit: true;
|
|
20
|
+
}, {
|
|
21
|
+
readonly name: "index";
|
|
22
|
+
readonly binary: "uint";
|
|
23
|
+
readonly size: 8;
|
|
24
|
+
}, {
|
|
25
|
+
readonly custom: {
|
|
26
|
+
to: (val: number) => "Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia";
|
|
27
|
+
from: (val: "Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia") => number;
|
|
28
|
+
};
|
|
29
|
+
readonly binary: "uint";
|
|
30
|
+
readonly size: 2;
|
|
31
|
+
readonly name: "targetChain";
|
|
32
|
+
}, {
|
|
33
|
+
readonly binary: "bytes";
|
|
34
|
+
readonly lengthSize: 2;
|
|
35
|
+
readonly name: "targetAddress";
|
|
36
|
+
}, {
|
|
37
|
+
readonly binary: "bytes";
|
|
38
|
+
readonly lengthSize: 2;
|
|
39
|
+
readonly name: "senderAddress";
|
|
40
|
+
}, {
|
|
41
|
+
readonly custom: any;
|
|
42
|
+
readonly name: "contents";
|
|
43
|
+
readonly binary: "bytes";
|
|
44
|
+
readonly lengthSize: 2;
|
|
45
|
+
} | {
|
|
46
|
+
readonly custom?: undefined;
|
|
47
|
+
readonly name: "contents";
|
|
48
|
+
readonly binary: "bytes";
|
|
49
|
+
readonly lengthSize: 2;
|
|
50
|
+
}]], readonly ["BamTokenMessage", readonly [{
|
|
51
|
+
readonly name: "magicByte";
|
|
52
|
+
readonly binary: "uint";
|
|
53
|
+
readonly size: 1;
|
|
54
|
+
readonly custom: 187;
|
|
55
|
+
readonly omit: true;
|
|
56
|
+
}, {
|
|
57
|
+
readonly name: "version";
|
|
58
|
+
readonly binary: "uint";
|
|
59
|
+
readonly size: 1;
|
|
60
|
+
readonly custom: 0;
|
|
61
|
+
readonly omit: true;
|
|
62
|
+
}, {
|
|
63
|
+
readonly name: "type";
|
|
64
|
+
readonly binary: "uint";
|
|
65
|
+
readonly size: 1;
|
|
66
|
+
readonly custom: 1;
|
|
67
|
+
readonly omit: true;
|
|
68
|
+
}, {
|
|
69
|
+
readonly name: "index";
|
|
70
|
+
readonly binary: "uint";
|
|
71
|
+
readonly size: 8;
|
|
72
|
+
}, {
|
|
73
|
+
readonly custom: {
|
|
74
|
+
to: (val: number) => "Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia";
|
|
75
|
+
from: (val: "Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia") => number;
|
|
76
|
+
};
|
|
77
|
+
readonly binary: "uint";
|
|
78
|
+
readonly size: 2;
|
|
79
|
+
readonly name: "targetChain";
|
|
80
|
+
}, {
|
|
81
|
+
readonly binary: "bytes";
|
|
82
|
+
readonly lengthSize: 2;
|
|
83
|
+
readonly name: "targetAddress";
|
|
84
|
+
}, {
|
|
85
|
+
readonly binary: "bytes";
|
|
86
|
+
readonly lengthSize: 2;
|
|
87
|
+
readonly name: "senderAddress";
|
|
88
|
+
}, {
|
|
89
|
+
readonly custom: any;
|
|
90
|
+
readonly name: "contents";
|
|
91
|
+
readonly binary: "bytes";
|
|
92
|
+
readonly lengthSize: 2;
|
|
93
|
+
} | {
|
|
94
|
+
readonly custom?: undefined;
|
|
95
|
+
readonly name: "contents";
|
|
96
|
+
readonly binary: "bytes";
|
|
97
|
+
readonly lengthSize: 2;
|
|
98
|
+
}, {
|
|
99
|
+
readonly custom: any;
|
|
100
|
+
readonly name: "bridge";
|
|
101
|
+
readonly binary: "uint";
|
|
102
|
+
readonly size: 1;
|
|
103
|
+
} | {
|
|
104
|
+
readonly custom?: undefined;
|
|
105
|
+
readonly name: "bridge";
|
|
106
|
+
readonly binary: "uint";
|
|
107
|
+
readonly size: 1;
|
|
108
|
+
}, {
|
|
109
|
+
readonly custom: any;
|
|
110
|
+
readonly name: "assetIdentifier";
|
|
111
|
+
readonly binary: "uint";
|
|
112
|
+
readonly size: 2;
|
|
113
|
+
} | {
|
|
114
|
+
readonly custom?: undefined;
|
|
115
|
+
readonly name: "assetIdentifier";
|
|
116
|
+
readonly binary: "uint";
|
|
117
|
+
readonly size: 2;
|
|
118
|
+
}, {
|
|
119
|
+
readonly binary: "uint";
|
|
120
|
+
readonly size: 32;
|
|
121
|
+
readonly name: "amount";
|
|
122
|
+
}]], readonly ["BamExtendedMessage", readonly [{
|
|
123
|
+
readonly name: "magicByte";
|
|
124
|
+
readonly binary: "uint";
|
|
125
|
+
readonly size: 1;
|
|
126
|
+
readonly custom: 187;
|
|
127
|
+
readonly omit: true;
|
|
128
|
+
}, {
|
|
129
|
+
readonly name: "version";
|
|
130
|
+
readonly binary: "uint";
|
|
131
|
+
readonly size: 1;
|
|
132
|
+
readonly custom: 0;
|
|
133
|
+
readonly omit: true;
|
|
134
|
+
}, {
|
|
135
|
+
readonly name: "type";
|
|
136
|
+
readonly binary: "uint";
|
|
137
|
+
readonly size: 1;
|
|
138
|
+
readonly custom: 2;
|
|
139
|
+
readonly omit: true;
|
|
140
|
+
}, {
|
|
141
|
+
readonly name: "index";
|
|
142
|
+
readonly binary: "uint";
|
|
143
|
+
readonly size: 8;
|
|
144
|
+
}, {
|
|
145
|
+
readonly custom: {
|
|
146
|
+
to: (val: number) => "Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia";
|
|
147
|
+
from: (val: "Solana" | "Btc" | "Algorand" | "Sui" | "Aptos" | "Near" | "Ethereum" | "Terra" | "Bsc" | "Polygon" | "Avalanche" | "Oasis" | "Aurora" | "Fantom" | "Karura" | "Acala" | "Klaytn" | "Celo" | "Moonbeam" | "Neon" | "Terra2" | "Injective" | "Osmosis" | "Arbitrum" | "Optimism" | "Gnosis" | "Pythnet" | "Xpla" | "Base" | "Sei" | "Rootstock" | "Wormchain" | "Cosmoshub" | "Evmos" | "Kujira" | "Sepolia") => number;
|
|
148
|
+
};
|
|
149
|
+
readonly binary: "uint";
|
|
150
|
+
readonly size: 2;
|
|
151
|
+
readonly name: "targetChain";
|
|
152
|
+
}, {
|
|
153
|
+
readonly binary: "bytes";
|
|
154
|
+
readonly lengthSize: 2;
|
|
155
|
+
readonly name: "targetAddress";
|
|
156
|
+
}, {
|
|
157
|
+
readonly binary: "bytes";
|
|
158
|
+
readonly lengthSize: 2;
|
|
159
|
+
readonly name: "senderAddress";
|
|
160
|
+
}, {
|
|
161
|
+
readonly custom: any;
|
|
162
|
+
readonly name: "contents";
|
|
163
|
+
readonly binary: "bytes";
|
|
164
|
+
readonly lengthSize: 2;
|
|
165
|
+
} | {
|
|
166
|
+
readonly custom?: undefined;
|
|
167
|
+
readonly name: "contents";
|
|
168
|
+
readonly binary: "bytes";
|
|
169
|
+
readonly lengthSize: 2;
|
|
170
|
+
}, {
|
|
171
|
+
readonly custom: any;
|
|
172
|
+
readonly name: "relaySignal";
|
|
173
|
+
readonly binary: "bytes";
|
|
174
|
+
readonly lengthSize: 2;
|
|
175
|
+
} | {
|
|
176
|
+
readonly custom?: undefined;
|
|
177
|
+
readonly name: "relaySignal";
|
|
178
|
+
readonly binary: "bytes";
|
|
179
|
+
readonly lengthSize: 2;
|
|
180
|
+
}]]];
|
|
181
|
+
declare global {
|
|
182
|
+
namespace Wormhole {
|
|
183
|
+
interface PayloadLiteralToDescriptionMapping extends ShallowMapping<typeof bamPayloads> {
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
//# sourceMappingURL=bam.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bam.d.ts","sourceRoot":"","sources":["../../../src/payloads/bam.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyD,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAgDtH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAImC,CAAC;AAI5D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,QAAQ,CAAC;QACjB,UAAU,kCACR,SAAQ,cAAc,CAAC,OAAO,WAAW,CAAC;SAAG;KAChD;CACF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.bamPayloads = void 0;
|
|
4
|
+
const layout_items_1 = require("../layout-items");
|
|
5
|
+
const vaa_1 = require("../vaa");
|
|
6
|
+
const bamAddressItem = {
|
|
7
|
+
binary: "bytes",
|
|
8
|
+
lengthSize: 2
|
|
9
|
+
};
|
|
10
|
+
const customOrEmpty = (custom) => custom ? { custom } : {};
|
|
11
|
+
const messageLayout = (type, customContents) => [
|
|
12
|
+
{ name: "magicByte", binary: "uint", size: 1, custom: 0xbb, omit: true },
|
|
13
|
+
{ name: "version", binary: "uint", size: 1, custom: 0, omit: true },
|
|
14
|
+
{ name: "type", binary: "uint", size: 1, custom: type, omit: true },
|
|
15
|
+
{ name: "index", binary: "uint", size: 8 },
|
|
16
|
+
{ name: "targetChain", ...(0, layout_items_1.chainItem)() },
|
|
17
|
+
{ name: "targetAddress", ...bamAddressItem },
|
|
18
|
+
{ name: "senderAddress", ...bamAddressItem },
|
|
19
|
+
{ name: "contents", binary: "bytes", lengthSize: 2, ...customOrEmpty(customContents) },
|
|
20
|
+
];
|
|
21
|
+
const tokenMessageLayout = (custom) => [
|
|
22
|
+
...messageLayout(1, custom?.contents),
|
|
23
|
+
{ name: "bridge", binary: "uint", size: 1, ...customOrEmpty(custom?.bridge) },
|
|
24
|
+
{ name: "assetIdentifier", binary: "uint", size: 2, ...customOrEmpty(custom?.assetIdentifier) },
|
|
25
|
+
{ name: "amount", ...layout_items_1.amountItem },
|
|
26
|
+
];
|
|
27
|
+
const extendedMessageLayout = (custom) => [
|
|
28
|
+
...messageLayout(2, custom?.contents),
|
|
29
|
+
{ name: "relaySignal", binary: "bytes", lengthSize: 2, ...customOrEmpty(custom?.relaySignal) },
|
|
30
|
+
];
|
|
31
|
+
exports.bamPayloads = [
|
|
32
|
+
["BamMessage", messageLayout(0)],
|
|
33
|
+
["BamTokenMessage", tokenMessageLayout()],
|
|
34
|
+
["BamExtendedMessage", extendedMessageLayout()],
|
|
35
|
+
];
|
|
36
|
+
exports.bamPayloads.forEach(([payloadLiteral, layout]) => (0, vaa_1.registerPayloadType)(payloadLiteral, layout));
|
|
37
|
+
//# sourceMappingURL=bam.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bam.js","sourceRoot":"","sources":["../../../src/payloads/bam.ts"],"names":[],"mappings":";;;AACA,kDAAwD;AACxD,gCAA6C;AAE7C,MAAM,cAAc,GAAG;IACrB,MAAM,EAAE,OAAO;IACf,UAAU,EAAE,CAAC;CACiD,CAAC;AAEjE,MAAM,aAAa,GAAG,CAAC,MAAW,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;AAEhE,MAAM,aAAa,GAAG,CAGpB,IAAO,EAAE,cAAkB,EAAE,EAAE,CAAC;IAChC,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;IACxE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE;IACnE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;IACnE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE;IAC1C,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,IAAA,wBAAS,GAAE,EAAE;IACvC,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,cAAc,EAAE;IAC5C,EAAE,IAAI,EAAE,eAAe,EAAE,GAA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