@wormhole-foundation/sdk-cosmwasm-ibc 4.22.0-beta.0 → 5.0.0-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wormhole-foundation/sdk-cosmwasm-ibc",
3
- "version": "4.22.0-beta.0",
3
+ "version": "5.0.0-beta.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/wormhole-foundation/wormhole-sdk-ts.git"
@@ -13,13 +13,12 @@
13
13
  "test": "tests"
14
14
  },
15
15
  "license": "Apache-2.0",
16
- "main": "./dist/cjs/index.js",
17
- "types": "./dist/cjs/index.d.ts",
16
+ "main": "./dist/esm/index.js",
17
+ "types": "./dist/esm/index.d.ts",
18
18
  "module": "./dist/esm/index.js",
19
19
  "description": "SDK for EVM chains, used in conjunction with @wormhole-foundation/sdk",
20
20
  "files": [
21
- "dist/esm",
22
- "dist/cjs"
21
+ "dist/esm"
23
22
  ],
24
23
  "keywords": [
25
24
  "wormhole",
@@ -35,17 +34,15 @@
35
34
  "evm"
36
35
  ],
37
36
  "engines": {
38
- "node": ">=16"
37
+ "node": ">=20.19"
39
38
  },
40
39
  "sideEffects": [
41
- "./dist/cjs/index.js",
42
40
  "./dist/esm/index.js"
43
41
  ],
44
42
  "scripts": {
45
43
  "recover": "tsx ./scripts/recoverChannels.ts",
46
- "build:cjs": "tsc -p ./tsconfig.cjs.json && echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
47
44
  "build:esm": "tsc -p ./tsconfig.esm.json",
48
- "build": "npm run build:esm && npm run build:cjs",
45
+ "build": "npm run build:esm",
49
46
  "rebuild": "npm run clean && npm run build",
50
47
  "clean": "rm -rf ./dist && rm -rf ./.turbo",
51
48
  "lint": "npm run prettier && eslint --fix ./src --ext .ts",
@@ -56,31 +53,16 @@
56
53
  "@cosmjs/stargate": "^0.32.0",
57
54
  "cosmjs-types": "^0.9.0",
58
55
  "@injectivelabs/sdk-ts": "^1.14.13-beta.2",
59
- "@wormhole-foundation/sdk-connect": "4.22.0-beta.0",
60
- "@wormhole-foundation/sdk-cosmwasm": "4.22.0-beta.0",
61
- "@wormhole-foundation/sdk-cosmwasm-core": "4.22.0-beta.0"
56
+ "@wormhole-foundation/sdk-connect": "5.0.0-beta.0",
57
+ "@wormhole-foundation/sdk-cosmwasm": "5.0.0-beta.0",
58
+ "@wormhole-foundation/sdk-cosmwasm-core": "5.0.0-beta.0"
62
59
  },
63
60
  "type": "module",
64
61
  "exports": {
65
62
  ".": {
66
- "react-native": {
67
- "import": "./dist/esm/index.js",
68
- "require": "./dist/cjs/index.js",
69
- "types": "./dist/cjs/index.d.ts",
70
- "default": "./dist/cjs/index.js"
71
- },
72
- "import": {
73
- "types": "./dist/esm/index.d.ts",
74
- "default": "./dist/esm/index.js"
75
- },
76
- "require": {
77
- "types": "./dist/cjs/index.d.ts",
78
- "default": "./dist/cjs/index.js"
79
- },
80
- "default": {
81
- "types": "./dist/cjs/index.d.ts",
82
- "default": "./dist/cjs/index.js"
83
- }
63
+ "types": "./dist/esm/index.d.ts",
64
+ "import": "./dist/esm/index.js",
65
+ "default": "./dist/esm/index.js"
84
66
  }
85
67
  }
86
68
  }
package/dist/cjs/ibc.d.ts DELETED
@@ -1,27 +0,0 @@
1
- import type { CosmWasmClient } from "@cosmjs/cosmwasm-stargate";
2
- import type { ChainAddress, ChainsConfig, Contracts, GatewayTransferMsg, GatewayTransferWithPayloadMsg, IbcBridge, IbcMessageId, IbcTransferInfo, Network, TxHash, WormholeMessageId } from "@wormhole-foundation/sdk-connect";
3
- import type { AnyCosmwasmAddress, CosmwasmChains, CosmwasmPlatformType } from "@wormhole-foundation/sdk-cosmwasm";
4
- import { CosmwasmUnsignedTransaction } from "@wormhole-foundation/sdk-cosmwasm";
5
- export declare class CosmwasmIbcBridge<N extends Network, C extends CosmwasmChains> implements IbcBridge<N, C> {
6
- readonly network: N;
7
- readonly chain: C;
8
- readonly rpc: CosmWasmClient;
9
- readonly contracts: Contracts;
10
- private gatewayAddress;
11
- private channelToChain;
12
- private chainToChannel;
13
- constructor(network: N, chain: C, rpc: CosmWasmClient, contracts: Contracts);
14
- static fromRpc<N extends Network>(rpc: CosmWasmClient, config: ChainsConfig<N, CosmwasmPlatformType>): Promise<CosmwasmIbcBridge<N, CosmwasmChains>>;
15
- getTransferChannel<C extends CosmwasmChains>(chain: C): string | null;
16
- transfer(sender: AnyCosmwasmAddress, recipient: ChainAddress, token: AnyCosmwasmAddress, amount: bigint): AsyncGenerator<CosmwasmUnsignedTransaction<N, C>>;
17
- lookupTransferFromTx(txid: TxHash): Promise<IbcTransferInfo[]>;
18
- lookupMessageFromIbcMsgId(msg: IbcMessageId): Promise<WormholeMessageId | null>;
19
- private lookupTxFromIbcMsgId;
20
- lookupTransferFromIbcMsgId(msg: IbcMessageId): Promise<IbcTransferInfo[]>;
21
- lookupTransferFromMsg(msg: GatewayTransferMsg | GatewayTransferWithPayloadMsg): Promise<IbcTransferInfo[]>;
22
- private fetchTransferInfo;
23
- private parseIbcTransferInfo;
24
- fetchTransferChannel(chain: CosmwasmChains): Promise<string>;
25
- private createUnsignedTx;
26
- }
27
- //# sourceMappingURL=ibc.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ibc.d.ts","sourceRoot":"","sources":["../../src/ibc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAKhE,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,SAAS,EAET,kBAAkB,EAClB,6BAA6B,EAC7B,SAAS,EACT,YAAY,EACZ,eAAe,EACf,OAAO,EACP,MAAM,EACN,iBAAiB,EAClB,MAAM,kCAAkC,CAAC;AAU1C,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EAGrB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAGL,2BAA2B,E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,6BAA6B,GACtD,OAAO,CAAC,eAAe,EAAE,CAAC;YA0Bf,iBAAiB;IA6B/B,OAAO,CAAC,oBAAoB;IA2CtB,oBAAoB,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;IAUlE,OAAO,CAAC,gBAAgB;CAazB"}
package/dist/cjs/ibc.js DELETED
@@ -1,247 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CosmwasmIbcBridge = void 0;
4
- const stargate_1 = require("@cosmjs/stargate");
5
- const tx_js_1 = require("cosmjs-types/ibc/applications/transfer/v1/tx.js");
6
- const sdk_connect_1 = require("@wormhole-foundation/sdk-connect");
7
- const sdk_cosmwasm_1 = require("@wormhole-foundation/sdk-cosmwasm");
8
- const sdk_cosmwasm_core_1 = require("@wormhole-foundation/sdk-cosmwasm-core");
9
- const millisToNano = (seconds) => seconds * 1_000_000;
10
- class CosmwasmIbcBridge {
11
- network;
12
- chain;
13
- rpc;
14
- contracts;
15
- gatewayAddress;
16
- // map the local channel ids to the remote chain
17
- channelToChain = new Map();
18
- chainToChannel = new Map();
19
- constructor(network, chain, rpc, contracts) {
20
- this.network = network;
21
- this.chain = chain;
22
- this.rpc = rpc;
23
- this.contracts = contracts;
24
- if (!sdk_cosmwasm_1.networkChainToChannels.has(network, chain))
25
- throw new Error("Unsupported IBC Chain, no channels available: " + chain);
26
- this.gatewayAddress = sdk_cosmwasm_1.Gateway.gatewayAddress(network);
27
- const channels = sdk_cosmwasm_1.networkChainToChannels.get(network, chain) ?? {};
28
- for (const [chain, channel] of Object.entries(channels)) {
29
- this.channelToChain.set(channel, chain);
30
- this.chainToChannel.set(chain, channel);
31
- }
32
- }
33
- static async fromRpc(rpc, config) {
34
- const [network, chain] = await sdk_cosmwasm_1.CosmwasmPlatform.chainFromRpc(rpc);
35
- const conf = config[chain];
36
- if (conf.network !== network)
37
- throw new Error("Network mismatch: " + conf.network + " != " + network);
38
- return new CosmwasmIbcBridge(network, chain, rpc, conf.contracts);
39
- }
40
- getTransferChannel(chain) {
41
- return this.chainToChannel.get(chain) ?? null;
42
- }
43
- async *transfer(sender, recipient, token, amount) {
44
- const senderAddress = new sdk_cosmwasm_1.CosmwasmAddress(sender).toString();
45
- const nonce = Math.round(Math.random() * 10000);
46
- // TODO: needs heavy testing
47
- let recipientAddress = sdk_connect_1.encoding.b64.encode((0, sdk_connect_1.chainToPlatform)(recipient.chain) === "Cosmwasm"
48
- ? recipient.address.toString()
49
- : recipient.address.toUniversalAddress().toUint8Array());
50
- const payload = {
51
- gateway_ibc_token_bridge_payload: {
52
- gateway_transfer: {
53
- recipient: recipientAddress,
54
- chain: (0, sdk_connect_1.toChainId)(recipient.chain),
55
- nonce,
56
- // TODO: fetch param of which contract?
57
- fee: "0",
58
- },
59
- },
60
- };
61
- const timeout = BigInt(millisToNano(Date.now() + sdk_cosmwasm_1.IBC_TIMEOUT_MILLIS));
62
- const memo = JSON.stringify(payload);
63
- const ibcDenom = (0, sdk_connect_1.isNative)(token)
64
- ? sdk_cosmwasm_1.CosmwasmPlatform.getNativeDenom(this.network, this.chain)
65
- : sdk_cosmwasm_1.Gateway.deriveIbcDenom(this.network, this.chain, new sdk_cosmwasm_1.CosmwasmAddress(token).toString());
66
- const ibcToken = (0, stargate_1.coin)(amount.toString(), ibcDenom.toString());
67
- const ibcMessage = {
68
- typeUrl: sdk_cosmwasm_1.IBC_MSG_TYPE,
69
- value: tx_js_1.MsgTransfer.fromPartial({
70
- sourcePort: sdk_cosmwasm_1.IBC_TRANSFER_PORT,
71
- sourceChannel: this.chainToChannel.get(sdk_cosmwasm_1.Gateway.chain),
72
- sender: senderAddress,
73
- receiver: this.gatewayAddress,
74
- token: ibcToken,
75
- timeoutTimestamp: timeout,
76
- memo,
77
- }),
78
- };
79
- yield this.createUnsignedTx({
80
- msgs: [ibcMessage],
81
- fee: (0, sdk_cosmwasm_1.computeFee)(this.network, this.chain),
82
- memo: "Wormhole.TransferToGateway",
83
- }, "IBC.transfer");
84
- return;
85
- }
86
- async lookupTransferFromTx(txid) {
87
- const txResults = await this.rpc.getTx(txid);
88
- if (!txResults)
89
- throw new Error(`No IBC transfer found on ${this.chain} with txid: ${txid}`);
90
- if (txResults.code !== 0)
91
- throw new Error(`Transaction failed: ${txResults.rawLog}`);
92
- const xfers = await this.fetchTransferInfo(txResults);
93
- if (xfers.length === 0)
94
- throw new Error(`No IBC transfers found on ${this.chain} with txid: ${txid}`);
95
- return xfers;
96
- }
97
- async lookupMessageFromIbcMsgId(msg) {
98
- const tx = await this.lookupTxFromIbcMsgId(msg);
99
- if (!tx)
100
- return null;
101
- return sdk_cosmwasm_core_1.CosmwasmWormholeCore.parseWormholeMessageId(sdk_cosmwasm_1.Gateway.chain, sdk_cosmwasm_1.Gateway.coreAddress(this.network), tx);
102
- }
103
- // Private because we dont want to expose the IndexedTx type
104
- async lookupTxFromIbcMsgId(msg) {
105
- const prefix = this.chain === msg.chain ? sdk_cosmwasm_1.IBC_PACKET_SEND : sdk_cosmwasm_1.IBC_PACKET_RECEIVE;
106
- const { srcChannel, dstChannel, sequence, srcPort, dstPort } = msg;
107
- // Find the transaction with matching payload
108
- const txResults = await this.rpc.searchTx([
109
- {
110
- key: `${prefix}.${sdk_cosmwasm_1.IBC_PACKET_DST}`,
111
- value: dstChannel,
112
- },
113
- {
114
- key: `${prefix}.${sdk_cosmwasm_1.IBC_PACKET_SRC}`,
115
- value: srcChannel,
116
- },
117
- {
118
- key: `${prefix}.${sdk_cosmwasm_1.IBC_PACKET_SRC_PORT}`,
119
- value: srcPort,
120
- },
121
- {
122
- key: `${prefix}.${sdk_cosmwasm_1.IBC_PACKET_DST_PORT}`,
123
- value: dstPort,
124
- },
125
- {
126
- key: `${prefix}.${sdk_cosmwasm_1.IBC_PACKET_SEQ}`,
127
- value: sequence.toString(),
128
- },
129
- ]);
130
- if (txResults.length === 0)
131
- return null;
132
- if (txResults.length > 1)
133
- console.error(`Expected 1 transaction, got ${txResults.length} found for IbcMsgid: ${msg}`);
134
- const [tx] = txResults;
135
- return tx;
136
- }
137
- async lookupTransferFromIbcMsgId(msg) {
138
- // Finds the transaction but there may be multiple
139
- // IBCTransfers as part of this
140
- const tx = await this.lookupTxFromIbcMsgId(msg);
141
- if (!tx)
142
- throw new Error(`No transfers found on ${this.chain} for msg: ${JSON.stringify(msg)}`);
143
- const xfers = await this.fetchTransferInfo(tx);
144
- if (xfers.length === 0)
145
- throw new Error(`No transfers found on ${this.chain} for msg: ${JSON.stringify(msg)}`);
146
- return xfers;
147
- }
148
- // Returns the IBC Transfer message content and IBC transfer information
149
- async lookupTransferFromMsg(msg) {
150
- const encodedPayload = sdk_connect_1.encoding.b64.encode(JSON.stringify(msg));
151
- // Find the transaction with matching payload
152
- const txResults = await this.rpc.searchTx([
153
- {
154
- key: "wasm.transfer_payload",
155
- value: encodedPayload,
156
- },
157
- ]);
158
- if (txResults.length === 0)
159
- throw new Error(`Found no transactions for payload: ` + JSON.stringify(encodedPayload));
160
- if (txResults.length !== 1)
161
- console.error("Expected 1 tx, got: ", txResults.length);
162
- const [tx] = txResults;
163
- const xfers = await this.fetchTransferInfo(tx);
164
- if (xfers.length === 0)
165
- throw new Error(`Found no transactions for payload: ` + JSON.stringify(encodedPayload));
166
- return xfers;
167
- }
168
- // fetch whether or not this transfer is pending
169
- async fetchTransferInfo(tx) {
170
- // Try to get all IBC packets (sent/received)
171
- const xfers = this.parseIbcTransferInfo(tx);
172
- const transfers = [];
173
- for (const xfer of xfers) {
174
- // If its present in the commitment results, its interpreted as in-flight
175
- // the client throws an error and we report any error as not in-flight
176
- const qc = sdk_cosmwasm_1.CosmwasmPlatform.getQueryClient(this.rpc);
177
- try {
178
- await qc.ibc.channel.packetCommitment(sdk_cosmwasm_1.IBC_TRANSFER_PORT, xfer.id.srcChannel, xfer.id.sequence);
179
- xfer.pending = true;
180
- }
181
- catch (e) {
182
- const notPending = e.message.includes("packet commitment hash not found: key not found");
183
- if (!notPending)
184
- throw e;
185
- }
186
- transfers.push(xfer);
187
- }
188
- return transfers;
189
- }
190
- parseIbcTransferInfo(tx) {
191
- // Try to get all IBC packets (sent/received)
192
- const packets = tx.events.filter((ev) => ev.type === sdk_cosmwasm_1.IBC_PACKET_SEND || ev.type === sdk_cosmwasm_1.IBC_PACKET_RECEIVE);
193
- if (packets.length === 0)
194
- throw new Error(`No IBC Transfers on ${this.chain} found in: ${tx.hash}`);
195
- // Try to assemble attributes from packet fields
196
- const xfers = new Set();
197
- for (const packet of packets) {
198
- const xfer = { pending: false };
199
- const msgId = {};
200
- for (const attr of packet.attributes) {
201
- // set on msgId
202
- if (attr.key === sdk_cosmwasm_1.IBC_PACKET_SRC)
203
- msgId.srcChannel = attr.value;
204
- if (attr.key === sdk_cosmwasm_1.IBC_PACKET_DST)
205
- msgId.dstChannel = attr.value;
206
- if (attr.key === sdk_cosmwasm_1.IBC_PACKET_SEQ)
207
- msgId.sequence = Number(attr.value);
208
- if (attr.key === sdk_cosmwasm_1.IBC_PACKET_SRC_PORT)
209
- msgId.srcPort = attr.value;
210
- if (attr.key === sdk_cosmwasm_1.IBC_PACKET_DST_PORT)
211
- msgId.dstPort = attr.value;
212
- // set on the xfer obj
213
- if (attr.key === sdk_cosmwasm_1.IBC_PACKET_DATA)
214
- xfer.data = JSON.parse(attr.value);
215
- }
216
- // If we're receiving a packet, we need figure out who sent it
217
- // possibly resolving by source channel
218
- // we assign the chain to the sender as iternally canonical
219
- msgId.chain =
220
- packet.type === sdk_cosmwasm_1.IBC_PACKET_SEND ? this.chain : this.channelToChain.get(msgId.dstChannel);
221
- // Note: using the type guard to tell us if we have all the fields we expect
222
- if ((0, sdk_connect_1.isIbcMessageId)(msgId))
223
- xfer.id = msgId;
224
- else
225
- throw new Error("Invalid IbcMessageId: " + JSON.stringify(msgId));
226
- if ((0, sdk_connect_1.isIbcTransferInfo)(xfer))
227
- xfers.add(xfer);
228
- else
229
- throw new Error("Invalid IbcTransferInfo: " + JSON.stringify(xfer));
230
- }
231
- return Array.from(xfers);
232
- }
233
- // Fetches the local channel for the given chain
234
- async fetchTransferChannel(chain) {
235
- if (this.chain !== sdk_cosmwasm_1.Gateway.chain)
236
- throw new Error("Cannot query the transfer channels from a non-gateway chain");
237
- const { channel } = await this.rpc.queryContractSmart(this.gatewayAddress, {
238
- ibc_channel: { chain_id: (0, sdk_connect_1.toChainId)(chain) },
239
- });
240
- return channel;
241
- }
242
- createUnsignedTx(txReq, description, parallelizable = false) {
243
- return new sdk_cosmwasm_1.CosmwasmUnsignedTransaction(txReq, this.network, this.chain, description, parallelizable);
244
- }
245
- }
246
- exports.CosmwasmIbcBridge = CosmwasmIbcBridge;
247
- //# sourceMappingURL=ibc.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ibc.js","sourceRoot":"","sources":["../../src/ibc.ts"],"names":[],"mappings":";;;AAEA,+CAAwC;AACxC,2EAA8E;AAgB9E,kEAO0C;AAS1C,oEAkB2C;AAE3C,8EAA8E;AAE9E,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,OAAO,GAAG,SAAS,CAAC;AAE9D,MAAa,iBAAiB;IAUjB;IACA;IACA;IACA;IAVH,cAAc,CAAS;IAE/B,gDAAgD;IACxC,cAAc,GAAgC,IAAI,GAAG,EAAE,CAAC;IACxD,cAAc,GAAgC,IAAI,GAAG,EAAE,CAAC;IAEhE,YACW,OAAU,EACV,KAAQ,EACR,GAAmB,EACnB,SAAoB;QAHpB,YAAO,GAAP,OAAO,CAAG;QACV,UAAK,GAAL,KAAK,CAAG;QACR,QAAG,GAAH,GAAG,CAAgB;QACnB,cAAS,GAAT,SAAS,CAAW;QAE7B,IAAI,CAAC,qCAAsB,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC;YAC7C,MAAM,IAAI,KAAK,CAAC,gDAAgD,GAAG,KAAK,CAAC,CAAC;QAE5E,IAAI,CAAC,cAAc,GAAG,sBAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAEtD,MAA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.js";
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAMA,cAAc,UAAU,CAAC"}
package/dist/cjs/index.js DELETED
@@ -1,22 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- const sdk_connect_1 = require("@wormhole-foundation/sdk-connect");
18
- const sdk_cosmwasm_1 = require("@wormhole-foundation/sdk-cosmwasm");
19
- const ibc_js_1 = require("./ibc.js");
20
- (0, sdk_connect_1.registerProtocol)(sdk_cosmwasm_1._platform, "IbcBridge", ibc_js_1.CosmwasmIbcBridge);
21
- __exportStar(require("./ibc.js"), exports);
22
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kEAAoE;AACpE,oEAA8D;AAC9D,qCAA6C;AAE7C,IAAA,8BAAgB,EAAC,wBAAS,EAAE,WAAW,EAAE,0BAAiB,CAAC,CAAC;AAE5D,2CAAyB"}
@@ -1 +0,0 @@
1
- {"type":"commonjs"}