@wormhole-foundation/sdk-cosmwasm 0.5.0-alpha.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/README.md +31 -0
- package/dist/cjs/address.d.ts +29 -0
- package/dist/cjs/address.d.ts.map +1 -0
- package/dist/cjs/address.js +217 -0
- package/dist/cjs/address.js.map +1 -0
- package/dist/cjs/chain.d.ts +5 -0
- package/dist/cjs/chain.d.ts.map +1 -0
- package/dist/cjs/chain.js +8 -0
- package/dist/cjs/chain.js.map +1 -0
- package/dist/cjs/constants.d.ts +771 -0
- package/dist/cjs/constants.d.ts.map +1 -0
- package/dist/cjs/constants.js +180 -0
- package/dist/cjs/constants.js.map +1 -0
- package/dist/cjs/gateway.d.ts +17 -0
- package/dist/cjs/gateway.d.ts.map +1 -0
- package/dist/cjs/gateway.js +75 -0
- package/dist/cjs/gateway.js.map +1 -0
- package/dist/cjs/index.d.ts +9 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +25 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/platform.d.ts +33 -0
- package/dist/cjs/platform.d.ts.map +1 -0
- package/dist/cjs/platform.js +131 -0
- package/dist/cjs/platform.js.map +1 -0
- package/dist/cjs/signer.d.ts +31 -0
- package/dist/cjs/signer.d.ts.map +1 -0
- package/dist/cjs/signer.js +114 -0
- package/dist/cjs/signer.js.map +1 -0
- package/dist/cjs/types.d.ts +18 -0
- package/dist/cjs/types.d.ts.map +1 -0
- package/dist/cjs/types.js +20 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/unsignedTransaction.d.ts +20 -0
- package/dist/cjs/unsignedTransaction.d.ts.map +1 -0
- package/dist/cjs/unsignedTransaction.js +43 -0
- package/dist/cjs/unsignedTransaction.js.map +1 -0
- package/dist/esm/address.d.ts +29 -0
- package/dist/esm/address.d.ts.map +1 -0
- package/dist/esm/address.js +213 -0
- package/dist/esm/address.js.map +1 -0
- package/dist/esm/chain.d.ts +5 -0
- package/dist/esm/chain.d.ts.map +1 -0
- package/dist/esm/chain.js +4 -0
- package/dist/esm/chain.js.map +1 -0
- package/dist/esm/constants.d.ts +771 -0
- package/dist/esm/constants.d.ts.map +1 -0
- package/dist/esm/constants.js +177 -0
- package/dist/esm/constants.js.map +1 -0
- package/dist/esm/gateway.d.ts +17 -0
- package/dist/esm/gateway.d.ts.map +1 -0
- package/dist/esm/gateway.js +71 -0
- package/dist/esm/gateway.js.map +1 -0
- package/dist/esm/index.d.ts +9 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/platform.d.ts +33 -0
- package/dist/esm/platform.d.ts.map +1 -0
- package/dist/esm/platform.js +127 -0
- package/dist/esm/platform.js.map +1 -0
- package/dist/esm/signer.d.ts +31 -0
- package/dist/esm/signer.d.ts.map +1 -0
- package/dist/esm/signer.js +108 -0
- package/dist/esm/signer.js.map +1 -0
- package/dist/esm/types.d.ts +18 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +16 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/unsignedTransaction.d.ts +20 -0
- package/dist/esm/unsignedTransaction.d.ts.map +1 -0
- package/dist/esm/unsignedTransaction.js +37 -0
- package/dist/esm/unsignedTransaction.js.map +1 -0
- package/package.json +63 -0
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Cosmwasm
|
|
2
|
+
--------
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
Stuff that idk what to do about yet
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# RPC
|
|
9
|
+
|
|
10
|
+
Right now, getRpc on the `Platform` type is sync, but the cosmjs client `connect` method is async. what do?
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# Addresses
|
|
14
|
+
|
|
15
|
+
Contract addresses are 32 bytes
|
|
16
|
+
|
|
17
|
+
"Regular" addresses are 20 bytes
|
|
18
|
+
|
|
19
|
+
Each chain has its own special prefix
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# Transfers into cosmos
|
|
23
|
+
|
|
24
|
+
Some knowledge of cosmos payload format is required to format the message correctly. This is somewhat similar to the need to understand Solana ATAs for transferring to Solana.
|
|
25
|
+
|
|
26
|
+
# Transfers between cosmos chains
|
|
27
|
+
|
|
28
|
+
No attestation will be created since no VAA is created so `fetchAttestation` is a noop?
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Address, UniversalAddress } from "@wormhole-foundation/sdk-connect";
|
|
2
|
+
import { AnyCosmwasmAddress } from "./types";
|
|
3
|
+
export declare class CosmwasmAddress implements Address {
|
|
4
|
+
static readonly contractAddressByteSize = 32;
|
|
5
|
+
static readonly accountAddressByteSize = 20;
|
|
6
|
+
readonly platform: "Cosmwasm";
|
|
7
|
+
readonly address: Uint8Array;
|
|
8
|
+
readonly domain?: string;
|
|
9
|
+
readonly denom?: string;
|
|
10
|
+
readonly denomType?: string;
|
|
11
|
+
constructor(address: AnyCosmwasmAddress);
|
|
12
|
+
unwrap(): string;
|
|
13
|
+
toString(): string;
|
|
14
|
+
toNative(): this;
|
|
15
|
+
toUint8Array(): Uint8Array;
|
|
16
|
+
toUniversalAddress(): UniversalAddress;
|
|
17
|
+
static isValidAddress(address: string): boolean;
|
|
18
|
+
private static validAddressLength;
|
|
19
|
+
static instanceof(address: any): address is CosmwasmAddress;
|
|
20
|
+
equals(other: CosmwasmAddress | UniversalAddress): boolean;
|
|
21
|
+
}
|
|
22
|
+
declare module "@wormhole-foundation/sdk-connect" {
|
|
23
|
+
namespace WormholeRegistry {
|
|
24
|
+
interface PlatformToNativeAddressMapping {
|
|
25
|
+
Cosmwasm: CosmwasmAddress;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=address.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["../../src/address.ts"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,gBAAgB,EAGjB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAa,MAAM,SAAS,CAAC;AAqFxD,qBAAa,eAAgB,YAAW,OAAO;IAC7C,MAAM,CAAC,QAAQ,CAAC,uBAAuB,MAAM;IAC7C,MAAM,CAAC,QAAQ,CAAC,sBAAsB,MAAM;IAC5C,SAAgB,QAAQ,aAA8B;IAGtD,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAG7B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;gBAEhB,OAAO,EAAE,kBAAkB;IAwDvC,MAAM,IAAI,MAAM;IAIhB,QAAQ,IAAI,MAAM;IAoBlB,QAAQ;IAIR,YAAY;IAIZ,kBAAkB;IAMlB,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAQ/C,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAajC,MAAM,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,GAAG,OAAO,IAAI,eAAe;IAI3D,MAAM,CAAC,KAAK,EAAE,eAAe,GAAG,gBAAgB,GAAG,OAAO;CAO3D;AAED,OAAO,QAAQ,kCAAkC,CAAC;IAChD,UAAiB,gBAAgB,CAAC;QAChC,UAAU,8BAA8B;YACtC,QAAQ,EAAE,eAAe,CAAC;SAC3B;KACF;CACF"}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CosmwasmAddress = void 0;
|
|
4
|
+
const encoding_1 = require("@cosmjs/encoding");
|
|
5
|
+
const sdk_connect_1 = require("@wormhole-foundation/sdk-connect");
|
|
6
|
+
const platform_1 = require("./platform");
|
|
7
|
+
const types_1 = require("./types");
|
|
8
|
+
/*
|
|
9
|
+
Categories:
|
|
10
|
+
|
|
11
|
+
Bank Tokens
|
|
12
|
+
|
|
13
|
+
uatom,ibc/...,factory/...
|
|
14
|
+
|
|
15
|
+
Contract Tokens
|
|
16
|
+
|
|
17
|
+
*/
|
|
18
|
+
/*
|
|
19
|
+
Cosmos Addresses
|
|
20
|
+
-----
|
|
21
|
+
|
|
22
|
+
There are at least 5 types of addresses in Cosmos:
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
Native Denom
|
|
26
|
+
ex: "uatom"
|
|
27
|
+
|
|
28
|
+
address = [] // 0 bytes
|
|
29
|
+
domain = undefined
|
|
30
|
+
denom = "uatom"
|
|
31
|
+
denomType = "native"
|
|
32
|
+
|
|
33
|
+
Contract Address
|
|
34
|
+
ex: "wormhole1ctnjk7an90lz5wjfvr3cf6x984a8cjnv8dpmztmlpcq4xteaa2xs9pwmzk"
|
|
35
|
+
|
|
36
|
+
address = [0x...] // 32 bytes
|
|
37
|
+
domain = "wormhole"
|
|
38
|
+
denom = undefined
|
|
39
|
+
denomType = undefined
|
|
40
|
+
|
|
41
|
+
Account Address
|
|
42
|
+
ex: "cosmos1hsk6jryyqjfhp5dhc55tc9jtckygx0eph6dd02"
|
|
43
|
+
|
|
44
|
+
address = [0x...] // 20 bytes
|
|
45
|
+
domain = "cosmos"
|
|
46
|
+
denom = undefined
|
|
47
|
+
denomType = undefined
|
|
48
|
+
|
|
49
|
+
IBC Denom
|
|
50
|
+
ex: IBC/BAEAC83736444C09656FBE666FB625974FCCDEE566EB700EBFD2642C5F6CF13A
|
|
51
|
+
|
|
52
|
+
address = [0x...] // 32 bytes
|
|
53
|
+
domain = undefined
|
|
54
|
+
denom = undefined
|
|
55
|
+
denomType = "IBC"
|
|
56
|
+
|
|
57
|
+
Factory Address
|
|
58
|
+
ex: "factory/inj17vytdwqczqz72j65saukplrktd4gyfme5agf6c/avax"
|
|
59
|
+
|
|
60
|
+
address = [0x...] 20 bytes
|
|
61
|
+
domain = "inj"
|
|
62
|
+
denom = "avax"
|
|
63
|
+
denomType = "factory"
|
|
64
|
+
|
|
65
|
+
Transfer Denom
|
|
66
|
+
ex: transfer/channel-486/factory/wormhole1ctnjk7an90lz5wjfvr3cf6x984a8cjnv8dpmztmlpcq4xteaa2xs9pwmzk/6vxRV62YN1CTZeQM5ZfvCZDCVA4nLhtZcLxziYa7xYqb
|
|
67
|
+
|
|
68
|
+
address = [0x...] 32 bytes
|
|
69
|
+
domain = "wormhole"
|
|
70
|
+
denom = "6vxRV62YN1CTZeQM5ZfvCZDCVA4nLhtZcLxziYa7xYqb"
|
|
71
|
+
denomType = "transfer/channel-486/factory"
|
|
72
|
+
*/
|
|
73
|
+
// Factory type addresses may have hex or b64 or bech32 encoded addresses
|
|
74
|
+
function tryDecode(data) {
|
|
75
|
+
try {
|
|
76
|
+
return { ...(0, encoding_1.fromBech32)(data) };
|
|
77
|
+
}
|
|
78
|
+
catch { }
|
|
79
|
+
try {
|
|
80
|
+
return { data: (0, encoding_1.fromHex)(data) };
|
|
81
|
+
}
|
|
82
|
+
catch { }
|
|
83
|
+
try {
|
|
84
|
+
return { data: (0, encoding_1.fromBase64)(data) };
|
|
85
|
+
}
|
|
86
|
+
catch { }
|
|
87
|
+
throw new Error(`Cannot decode: ${data}`);
|
|
88
|
+
}
|
|
89
|
+
class CosmwasmAddress {
|
|
90
|
+
static contractAddressByteSize = 32;
|
|
91
|
+
static accountAddressByteSize = 20;
|
|
92
|
+
platform = platform_1.CosmwasmPlatform._platform;
|
|
93
|
+
// the actual bytes of the address
|
|
94
|
+
address;
|
|
95
|
+
// The domain is the prefix for the address, like "cosmos" or "ibc"
|
|
96
|
+
domain;
|
|
97
|
+
// The denom is the token name, like "uatom" or "usdc"
|
|
98
|
+
denom;
|
|
99
|
+
// The denomType is "native", "ibc", or "factory"
|
|
100
|
+
denomType;
|
|
101
|
+
constructor(address) {
|
|
102
|
+
if (CosmwasmAddress.instanceof(address)) {
|
|
103
|
+
const a = address;
|
|
104
|
+
this.address = a.address;
|
|
105
|
+
this.domain = a.domain;
|
|
106
|
+
this.denom = a.denom;
|
|
107
|
+
this.denomType = a.denomType;
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (typeof address === "string") {
|
|
111
|
+
// A native denom like "uatom"
|
|
112
|
+
if (address.length <= 8) {
|
|
113
|
+
this.address = new Uint8Array(0);
|
|
114
|
+
this.denom = address;
|
|
115
|
+
this.denomType = "native";
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
if (address.indexOf("/") !== -1) {
|
|
119
|
+
// A denom address like "ibc/..." or "factory/..." or "transfer/channel-${id}/factory/..."
|
|
120
|
+
const chunks = address.split("/");
|
|
121
|
+
// It's a `transfer/...` denom
|
|
122
|
+
if (chunks.length >= 3) {
|
|
123
|
+
// Address will be second from the last
|
|
124
|
+
const { data, prefix } = tryDecode(chunks[chunks.length - 2]);
|
|
125
|
+
this.address = data;
|
|
126
|
+
this.domain = prefix;
|
|
127
|
+
this.denom = chunks[chunks.length - 1];
|
|
128
|
+
this.denomType = chunks.slice(0, chunks.length - 2).join("/");
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
const { data } = tryDecode(chunks[1]);
|
|
132
|
+
this.address = data;
|
|
133
|
+
this.denomType = chunks[0];
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
// should be a contract or account address by now
|
|
138
|
+
if (!CosmwasmAddress.isValidAddress(address))
|
|
139
|
+
throw new Error(`Invalid Cosmwasm address: ${address}`);
|
|
140
|
+
const { data, prefix } = (0, encoding_1.fromBech32)(address);
|
|
141
|
+
this.address = data;
|
|
142
|
+
this.domain = prefix;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
else if (address instanceof Uint8Array) {
|
|
146
|
+
this.address = address;
|
|
147
|
+
}
|
|
148
|
+
else if (sdk_connect_1.UniversalAddress.instanceof(address)) {
|
|
149
|
+
this.address = address.toUint8Array();
|
|
150
|
+
}
|
|
151
|
+
else
|
|
152
|
+
throw new Error(`Invalid Cosmwasm address ${address}`);
|
|
153
|
+
if (!CosmwasmAddress.validAddressLength(this.address)) {
|
|
154
|
+
throw new Error("Expected 20 or 32 bytes address");
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
unwrap() {
|
|
158
|
+
return this.toString();
|
|
159
|
+
}
|
|
160
|
+
toString() {
|
|
161
|
+
// Coin address
|
|
162
|
+
if (this.denomType !== undefined) {
|
|
163
|
+
// native asset denom
|
|
164
|
+
if (this.denomType === "native")
|
|
165
|
+
return this.denom;
|
|
166
|
+
// ibc/hex
|
|
167
|
+
if (this.denomType === "ibc") {
|
|
168
|
+
// NOTE: this is case sensitive, should be `ibc` not `IBC`
|
|
169
|
+
return `${this.denomType.toLowerCase()}/${sdk_connect_1.encoding.hex.encode(this.address).toUpperCase()}`;
|
|
170
|
+
}
|
|
171
|
+
// ?/factory/address/denom
|
|
172
|
+
return `${this.denomType}/${(0, encoding_1.toBech32)(this.domain, this.address)}/${this.denom}`;
|
|
173
|
+
}
|
|
174
|
+
// contract or account address
|
|
175
|
+
return (0, encoding_1.toBech32)(this.domain, this.address);
|
|
176
|
+
}
|
|
177
|
+
toNative() {
|
|
178
|
+
return this;
|
|
179
|
+
}
|
|
180
|
+
toUint8Array() {
|
|
181
|
+
return this.address;
|
|
182
|
+
}
|
|
183
|
+
toUniversalAddress() {
|
|
184
|
+
const buff = new Uint8Array(sdk_connect_1.UniversalAddress.byteSize);
|
|
185
|
+
buff.set(this.address, sdk_connect_1.UniversalAddress.byteSize - this.address.length);
|
|
186
|
+
return new sdk_connect_1.UniversalAddress(buff);
|
|
187
|
+
}
|
|
188
|
+
static isValidAddress(address) {
|
|
189
|
+
try {
|
|
190
|
+
const maybe = (0, encoding_1.fromBech32)(address);
|
|
191
|
+
return CosmwasmAddress.validAddressLength(maybe.data);
|
|
192
|
+
}
|
|
193
|
+
catch { }
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
static validAddressLength(address) {
|
|
197
|
+
if (address.length !== CosmwasmAddress.contractAddressByteSize &&
|
|
198
|
+
address.length !== CosmwasmAddress.accountAddressByteSize)
|
|
199
|
+
throw new Error(`Invalid Cosmwasm address, expected ${CosmwasmAddress.contractAddressByteSize} ` +
|
|
200
|
+
`or ${CosmwasmAddress.accountAddressByteSize} bytes but got ${address.length}`);
|
|
201
|
+
return true;
|
|
202
|
+
}
|
|
203
|
+
static instanceof(address) {
|
|
204
|
+
return address.platform === platform_1.CosmwasmPlatform._platform;
|
|
205
|
+
}
|
|
206
|
+
equals(other) {
|
|
207
|
+
if (CosmwasmAddress.instanceof(other)) {
|
|
208
|
+
return this.toString() === other.toString();
|
|
209
|
+
}
|
|
210
|
+
else {
|
|
211
|
+
return other.equals(this.toUniversalAddress());
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
exports.CosmwasmAddress = CosmwasmAddress;
|
|
216
|
+
(0, sdk_connect_1.registerNative)(types_1._platform, CosmwasmAddress);
|
|
217
|
+
//# sourceMappingURL=address.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address.js","sourceRoot":"","sources":["../../src/address.ts"],"names":[],"mappings":";;;AAAA,+CAA6E;AAC7E,kEAK0C;AAC1C,yCAA8C;AAC9C,mCAAwD;AAExD;;;;;;;;;EASE;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsDE;AAEF,yEAAyE;AACzE,SAAS,SAAS,CAAC,IAAY;IAC7B,IAAI;QACF,OAAO,EAAE,GAAG,IAAA,qBAAU,EAAC,IAAI,CAAC,EAAE,CAAC;KAChC;IAAC,MAAM,GAAE;IAEV,IAAI;QACF,OAAO,EAAE,IAAI,EAAE,IAAA,kBAAO,EAAC,IAAI,CAAC,EAAE,CAAC;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1
|
+
import { Chain, ChainContext, Network } from "@wormhole-foundation/sdk-connect";
|
|
2
|
+
import { CosmwasmChains } from "./types";
|
|
3
|
+
export declare class CosmwasmChain<N extends Network = Network, C extends Chain = CosmwasmChains> extends ChainContext<N, C> {
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=chain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../src/chain.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,qBAAa,aAAa,CACxB,CAAC,SAAS,OAAO,GAAG,OAAO,EAC3B,CAAC,SAAS,KAAK,GAAG,cAAc,CAChC,SAAQ,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC;CAAG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CosmwasmChain = void 0;
|
|
4
|
+
const sdk_connect_1 = require("@wormhole-foundation/sdk-connect");
|
|
5
|
+
class CosmwasmChain extends sdk_connect_1.ChainContext {
|
|
6
|
+
}
|
|
7
|
+
exports.CosmwasmChain = CosmwasmChain;
|
|
8
|
+
//# sourceMappingURL=chain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../src/chain.ts"],"names":[],"mappings":";;;AAAA,kEAAgF;AAGhF,MAAa,aAGX,SAAQ,0BAAkB;CAAG;AAH/B,sCAG+B"}
|