@agoric/orchestration 0.1.1-dev-f04cf72.0 → 0.1.1-dev-9a2121d.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": "@agoric/orchestration",
3
- "version": "0.1.1-dev-f04cf72.0+f04cf72",
3
+ "version": "0.1.1-dev-9a2121d.0+9a2121d",
4
4
  "description": "Chain abstraction for Agoric's orchestration clients",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -10,6 +10,7 @@
10
10
  },
11
11
  "scripts": {
12
12
  "esbuild:axelar": "esbuild ./src/examples/axelar-gmp.contract.js --platform=node --format=esm --bundle --outfile=dist/axelar-gmp.contract.bundle.js",
13
+ "codegen:viem-abi": "tsup",
13
14
  "build": "yarn esbuild:axelar",
14
15
  "codegen": "scripts/fetch-chain-info.ts",
15
16
  "prepack": "yarn run -T tsc --build tsconfig.build.json",
@@ -56,8 +57,7 @@
56
57
  "@endo/patterns": "^1.5.0",
57
58
  "@noble/hashes": "^1.5.0",
58
59
  "bs58": "^6.0.0",
59
- "esbuild": "^0.25.2",
60
- "viem": "^2.31.0"
60
+ "esbuild": "^0.25.2"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@agoric/swingset-liveslots": "workspace:*",
@@ -71,7 +71,9 @@
71
71
  "bech32": "^2.0.0",
72
72
  "c8": "^10.1.3",
73
73
  "prettier": "^3.5.3",
74
- "ts-blank-space": "^0.6.1"
74
+ "ts-blank-space": "^0.6.1",
75
+ "tsup": "^8.5.0",
76
+ "viem": "^2.31.0"
75
77
  },
76
78
  "ava": {
77
79
  "extensions": {
@@ -103,5 +105,5 @@
103
105
  "typeCoverage": {
104
106
  "atLeast": 97.7
105
107
  },
106
- "gitHead": "f04cf725b3b98261b2fdcd978d44c584930c9c2f"
108
+ "gitHead": "9a2121d97ae4452d59f2eeae2d9c000ccb193566"
107
109
  }
@@ -1 +1 @@
1
- {"version":3,"file":"axelar-gmp-account-kit.d.ts","sourceRoot":"","sources":["axelar-gmp-account-kit.js"],"names":[],"mappings":"AAgEO,2CARI,IAAI,oCACJ;IACN,GAAG,EAAE,GAAG,CAAC;IACT,QAAQ,EAAE,QAAQ,CAAC;IACnB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,IAAI,CAAC,CAAC;IAChC,QAAQ,EAAE,QAAQ,CAAC;CACpB;;QAsCI;;WAEG;6BADQ,iBAAiB;;;;;;QAyE5B;;;;;;;WAOG;wBAHQ,OAAO,uBAAuB,EAAE,kBAAkB,UAClD,OAAO,uBAAuB,EAAE,SAAS,GACvC,OAAO,CAAC,MAAM,CAAC;QAO5B;;;;;;;;;WASG;sBARQ,OAAO,aACP;YACN,kBAAkB,EAAE,MAAM,CAAC;YAC3B,IAAI,EAAE,cAAc,CAAC;YACrB,mBAAmB,EAAE,kBAAkB,CAAC;YACxC,SAAS,EAAE,MAAM,CAAC;YAClB,sBAAsB,EAAE,YAAY,EAAE,CAAC;SACxC;QA4FJ;;;WAGG;sBAFQ,OAAO,QACP,GAAG;;;;;GAoErB;2BAzVa,YAAY;gCA2VZ,UAAU,CAAC,OAAO,oBAAoB,CAAC;4BACvC,UAAU,CAAC,iBAAiB,CAAC;0BArWpB,cAAc;yBAKN,aAAa;8BANZ,aAAa;yBAAb,aAAa;8BAIlB,uBAAuB;iCACqC,oBAAoB;uCANvE,cAAc;6BAOnB,aAAa;oCACY,oBAAoB;wCAFW,oBAAoB;kCAApB,oBAAoB"}
1
+ {"version":3,"file":"axelar-gmp-account-kit.d.ts","sourceRoot":"","sources":["axelar-gmp-account-kit.js"],"names":[],"mappings":"AAgEO,2CARI,IAAI,oCACJ;IACN,GAAG,EAAE,GAAG,CAAC;IACT,QAAQ,EAAE,QAAQ,CAAC;IACnB,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,IAAI,CAAC,CAAC;IAChC,QAAQ,EAAE,QAAQ,CAAC;CACpB;;QAwCI;;WAEG;6BADQ,iBAAiB;;;;;;QAyE5B;;;;;;;WAOG;wBAHQ,OAAO,uBAAuB,EAAE,kBAAkB,UAClD,OAAO,uBAAuB,EAAE,SAAS,GACvC,OAAO,CAAC,MAAM,CAAC;QAO5B;;;;;;;;;WASG;sBARQ,OAAO,aACP;YACN,kBAAkB,EAAE,MAAM,CAAC;YAC3B,IAAI,EAAE,cAAc,CAAC;YACrB,mBAAmB,EAAE,kBAAkB,CAAC;YACxC,SAAS,EAAE,MAAM,CAAC;YAClB,sBAAsB,EAAE,YAAY,EAAE,CAAC;SACxC;QA4FJ;;;WAGG;sBAFQ,OAAO,QACP,GAAG;;;;;GAoErB;2BA3Va,YAAY;gCA6VZ,UAAU,CAAC,OAAO,oBAAoB,CAAC;4BACvC,UAAU,CAAC,iBAAiB,CAAC;0BAvWpB,cAAc;yBAKN,aAAa;8BANZ,aAAa;yBAAb,aAAa;8BAIlB,uBAAuB;iCACqC,oBAAoB;uCANvE,cAAc;6BAOnB,aAAa;oCACY,oBAAoB;wCAFW,oBAAoB;kCAApB,oBAAoB"}
@@ -16,8 +16,8 @@ import { M, mustMatch } from '@endo/patterns';
16
16
  import { VowShape } from '@agoric/vow';
17
17
  import { makeTracer, NonNullish } from '@agoric/internal';
18
18
  import { atob, decodeBase64 } from '@endo/base64';
19
- import { decodeAbiParameters } from 'viem';
20
19
  import { Fail } from '@endo/errors';
20
+ import { decodeAbiParameters } from '../vendor/viem/viem-abi.js';
21
21
  import { CosmosChainAddressShape } from '../typeGuards.js';
22
22
  import { gmpAddresses, buildGMPPayload } from '../utils/gmp.js';
23
23
 
@@ -90,9 +90,11 @@ export const prepareEvmAccountKit = (
90
90
  mustMatch(initialState, EvmKitStateShape);
91
91
  return harden({
92
92
  evmAccountAddress: /** @type {string | undefined} */ (undefined),
93
- latestMessage: /**
94
- * @type {{ success: boolean; result: `0x${string}` }[] | undefined}
95
- */ (undefined),
93
+ /**
94
+ * @type {{ success: boolean; result: `0x${string}` }[]
95
+ * | undefined}
96
+ */
97
+ latestMessage: undefined,
96
98
  ...initialState,
97
99
  });
98
100
  },
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @file bundling these functions results in something that
3
+ * depends on node APIs such as stream and crypto (viem/utils
4
+ * includes an http client etc.)
5
+ *
6
+ * So we use tsup to do dead code elimination, aka tree-shaking,
7
+ * while preserving type info.
8
+ */
9
+ export { encodeFunctionData } from 'viem/utils';
10
+ export { decodeAbiParameters } from 'viem/utils';
11
+ export { encodeAbiParameters } from 'viem/utils';
12
+ //# sourceMappingURL=viem-abi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viem-abi.d.ts","sourceRoot":"","sources":["viem-abi.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @file bundling these functions results in something that
3
+ * depends on node APIs such as stream and crypto (viem/utils
4
+ * includes an http client etc.)
5
+ *
6
+ * So we use tsup to do dead code elimination, aka tree-shaking,
7
+ * while preserving type info.
8
+ */
9
+ export { encodeFunctionData } from 'viem/utils';
10
+ export { decodeAbiParameters } from 'viem/utils';
11
+ export { encodeAbiParameters } from 'viem/utils';
@@ -1 +1 @@
1
- {"version":3,"file":"gmp.d.ts","sourceRoot":"","sources":["gmp.js"],"names":[],"mappings":";;;;;AAaA;;;;;;GAMG;AACH,2BANU;IACL,UAAU,EAAE,aAAa,CAAC;IAC1B,UAAU,EAAE,aAAa,CAAC;IAC1B,gBAAgB,EAAE,aAAa,CAAC;CACjC,CAOF;AAQK,2EAHI,YAAY,GACV,sBAAsB,CAoBlC;AAQM,+CAHI,YAAY,EAAE,GACZ,MAAM,EAAE,CAyBpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCA9E+B,uBAAuB;kCADA,oBAAoB;4CAApB,oBAAoB"}
1
+ {"version":3,"file":"gmp.d.ts","sourceRoot":"","sources":["gmp.js"],"names":[],"mappings":";;;;;AAoBA;;;;;;GAMG;AACH,2BANU;IACL,UAAU,EAAE,aAAa,CAAC;IAC1B,UAAU,EAAE,aAAa,CAAC;IAC1B,gBAAgB,EAAE,aAAa,CAAC;CACjC,CAOF;AAQK,2EAHI,YAAY,GACV,sBAAsB,CAoBlC;AAQM,+CAHI,YAAY,EAAE,GACZ,MAAM,EAAE,CAyBpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCA9E+B,uBAAuB;kCADA,oBAAoB;4CAApB,oBAAoB"}
package/src/utils/gmp.js CHANGED
@@ -1,4 +1,11 @@
1
- import { encodeFunctionData, encodeAbiParameters, hexToBytes } from 'viem';
1
+ import { fromHex } from '@cosmjs/encoding';
2
+ import {
3
+ encodeAbiParameters,
4
+ encodeFunctionData,
5
+ } from '../vendor/viem/viem-abi.js';
6
+
7
+ /** @param {string} hex */
8
+ const hexToBytes = hex => fromHex(hex.slice(2));
2
9
 
3
10
  /**
4
11
  * @import {ContractCall, AbiEncodedContractCall} from '../axelar-types.js';