@agoric/orchestration 0.1.1-dev-25249e1.0.25249e1 → 0.1.1-dev-a88dd7f.0.a88dd7f
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 +16 -16
- package/src/axelar-types.d.ts +2 -0
- package/src/axelar-types.d.ts.map +1 -1
- package/src/axelar-types.js +2 -0
- package/src/utils/address.d.ts +2 -0
- package/src/utils/address.d.ts.map +1 -1
- package/src/utils/address.js +11 -0
- package/src/utils/gmp.d.ts +1 -1
- package/src/utils/gmp.d.ts.map +1 -1
- package/src/utils/gmp.js +17 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/orchestration",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-a88dd7f.0.a88dd7f",
|
|
4
4
|
"description": "Chain abstraction for Agoric's orchestration clients",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -35,19 +35,19 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@agoric/async-flow": "0.1.1-dev-
|
|
39
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
40
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
41
|
-
"@agoric/internal": "0.3.3-dev-
|
|
42
|
-
"@agoric/network": "0.1.1-dev-
|
|
43
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
44
|
-
"@agoric/store": "0.9.3-dev-
|
|
45
|
-
"@agoric/time": "0.3.3-dev-
|
|
46
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
47
|
-
"@agoric/vats": "0.15.2-dev-
|
|
48
|
-
"@agoric/vow": "0.1.1-dev-
|
|
49
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
50
|
-
"@agoric/zone": "0.2.3-dev-
|
|
38
|
+
"@agoric/async-flow": "0.1.1-dev-a88dd7f.0.a88dd7f",
|
|
39
|
+
"@agoric/cosmic-proto": "0.4.1-dev-a88dd7f.0.a88dd7f",
|
|
40
|
+
"@agoric/ertp": "0.16.3-dev-a88dd7f.0.a88dd7f",
|
|
41
|
+
"@agoric/internal": "0.3.3-dev-a88dd7f.0.a88dd7f",
|
|
42
|
+
"@agoric/network": "0.1.1-dev-a88dd7f.0.a88dd7f",
|
|
43
|
+
"@agoric/notifier": "0.6.3-dev-a88dd7f.0.a88dd7f",
|
|
44
|
+
"@agoric/store": "0.9.3-dev-a88dd7f.0.a88dd7f",
|
|
45
|
+
"@agoric/time": "0.3.3-dev-a88dd7f.0.a88dd7f",
|
|
46
|
+
"@agoric/vat-data": "0.5.3-dev-a88dd7f.0.a88dd7f",
|
|
47
|
+
"@agoric/vats": "0.15.2-dev-a88dd7f.0.a88dd7f",
|
|
48
|
+
"@agoric/vow": "0.1.1-dev-a88dd7f.0.a88dd7f",
|
|
49
|
+
"@agoric/zoe": "0.26.3-dev-a88dd7f.0.a88dd7f",
|
|
50
|
+
"@agoric/zone": "0.2.3-dev-a88dd7f.0.a88dd7f",
|
|
51
51
|
"@cosmjs/encoding": "^0.36.0",
|
|
52
52
|
"@endo/base64": "^1.0.12",
|
|
53
53
|
"@endo/errors": "^1.2.13",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"bs58": "^6.0.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
63
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-a88dd7f.0.a88dd7f",
|
|
64
64
|
"@chain-registry/client": "^1.53.194",
|
|
65
65
|
"@cosmjs/amino": "^0.36.0",
|
|
66
66
|
"@cosmjs/proto-signing": "^0.36.0",
|
|
@@ -105,5 +105,5 @@
|
|
|
105
105
|
"typeCoverage": {
|
|
106
106
|
"atLeast": 97.63
|
|
107
107
|
},
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "a88dd7fc0ccfa5ab8c6ed52fd2cde35261ddda1c"
|
|
109
109
|
}
|
package/src/axelar-types.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export type ContractCall = {
|
|
|
36
36
|
target: `0x${string}`;
|
|
37
37
|
functionSignature: string;
|
|
38
38
|
args: unknown[];
|
|
39
|
+
abi?: Abi | undefined;
|
|
39
40
|
};
|
|
40
41
|
export type AbiEncodedContractCall = {
|
|
41
42
|
target: `0x${string}`;
|
|
@@ -47,5 +48,6 @@ import type { OrchestrationAccount } from '@agoric/orchestration';
|
|
|
47
48
|
import type { CosmosChainAddress } from '@agoric/orchestration';
|
|
48
49
|
import type { IBCChannelID } from '@agoric/vats';
|
|
49
50
|
import type { Denom } from '@agoric/orchestration';
|
|
51
|
+
import type { Abi } from 'viem';
|
|
50
52
|
import type { EVM_CHAINS } from './utils/gmp.js';
|
|
51
53
|
//# sourceMappingURL=axelar-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axelar-types.d.ts","sourceRoot":"","sources":["axelar-types.js"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"axelar-types.d.ts","sourceRoot":"","sources":["axelar-types.js"],"names":[],"mappings":";;;;;6BAyBa,CAAC,OAAO,oBAAoB,EAAE,MAAM,OAAO,oBAAoB,CAAC;;kBAK/D,MAAM;oBACN,MAAM;aACN,MAAM;UACN,cAAc;;;YAKd,MAAM;eACN,aAAa;;;uBAKb,MAAM;yBACN,MAAM;aACN,MAAM,EAAE,GAAG,IAAI;UACf,cAAc;;;;kBAMd,qBAAqB;QAAE,OAAO,EAAE,QAAQ,CAAA;KAAE,CAAC;uBAC3C,kBAAkB;mBAClB,YAAY;gBACZ,KAAK;YACL,GAAG;qBACH,GAAG;WACH,MAAM;;;YAKN,KAAK,MAAM,EAAE;uBACb,MAAM;UACN,OAAO,EAAE;;;;YAMT,KAAK,MAAM,EAAE;UACb,KAAK,MAAM,EAAE;;iCAId,MAAa,iBAAU;mCAzEV,uBAAuB;0CAAvB,uBAAuB;wCAAvB,uBAAuB;kCAClB,cAAc;2BADnB,uBAAuB;yBAG3B,MAAM;gCADC,gBAAgB"}
|
package/src/axelar-types.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Bech32Address,} from '@agoric/orchestration';
|
|
6
6
|
* @import {IBCChannelID} from '@agoric/vats';
|
|
7
7
|
* @import {EVM_CHAINS} from './utils/gmp.js';
|
|
8
|
+
* @import {Abi} from 'viem';
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
11
|
// NOTE: The following 3 types are also documented in README.md located at:
|
|
@@ -64,6 +65,7 @@ harden(AxelarGMPMessageType);
|
|
|
64
65
|
* @property {`0x${string}`} target
|
|
65
66
|
* @property {string} functionSignature
|
|
66
67
|
* @property {unknown[]} args
|
|
68
|
+
* @property {Abi} [abi]
|
|
67
69
|
*/
|
|
68
70
|
|
|
69
71
|
/**
|
package/src/utils/address.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export const DEFAULT_ICQ_VERSION: "icq-1";
|
|
|
3
3
|
export function makeICQChannelAddress(controllerConnectionId: IBCConnectionID, version?: string): RemoteIbcAddress;
|
|
4
4
|
export function findAddressField(remoteAddressString: RemoteIbcAddress): CosmosChainAddress["value"] | undefined;
|
|
5
5
|
export function getBech32Prefix(address: Bech32Address | string): string;
|
|
6
|
+
export function sameEvmAddress(a: EvmAddress, b: EvmAddress): boolean;
|
|
6
7
|
export function coerceAccountId(idArg: AccountIdArg): AccountId;
|
|
7
8
|
export function parseAccountIdArg(idArg: AccountIdArg): Caip10Record;
|
|
8
9
|
export function parseAccountId(accountId: AccountId): Caip10Record;
|
|
@@ -35,6 +36,7 @@ import type { IBCConnectionID } from '@agoric/vats';
|
|
|
35
36
|
import type { RemoteIbcAddress } from '@agoric/vats/tools/ibc-utils.js';
|
|
36
37
|
import type { CosmosChainAddress } from '../types.js';
|
|
37
38
|
import type { Bech32Address } from '../types.js';
|
|
39
|
+
import type { Address as EvmAddress } from 'viem';
|
|
38
40
|
import type { AccountIdArg } from '../orchestration-api.js';
|
|
39
41
|
import type { AccountId } from '../orchestration-api.js';
|
|
40
42
|
import type { Caip10Record } from '../orchestration-api.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["address.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"address.d.ts","sourceRoot":"","sources":["address.js"],"names":[],"mappings":"AA6BO,wDALI,eAAe,0BACf,eAAe,6CACf,qBAAqB,GACnB,gBAAgB,CA4B5B;AAGD,kCAAmC,OAAO,CAAC;AAOpC,8DAJI,eAAe,YACf,MAAM,GACJ,gBAAgB,CAa5B;AAaM,sDAJI,gBAAgB,GAEd,kBAAkB,CAAC,OAAO,CAAC,GAAG,SAAS,CAYnD;AAaM,yCAHI,aAAa,GAAG,MAAM,GACpB,MAAM,CAQlB;AASM,kCAJI,UAAU,KACV,UAAU,GACR,OAAO,CAEuD;AAYpE,uCAJI,YAAY,GAEV,SAAS,CAQrB;AAUM,yCAJI,YAAY,GAEV,YAAY,CAaxB;AASM,0CAHI,SAAS,GACP,YAAY,CAaxB;AAUM,6CAJI,YAAY,GAEV,WAAW,CAKvB;AASM,yCAJI,MAAM,GACJ,OAAO,CAkBnB;AAUM,6CAHI,MAAM,GACJ,QAAQ,OAAO,IAAI,aAAa,CAM5C;AAUM,uDAFI,MAAM,+BAOhB;AAWM,8CAJI,SAAS,GACP,UAAU,CAatB;;;;;;;;;;;;;;;;;;;;;qCA3QiC,cAAc;sCAIb,iCAAiC;wCAFH,aAAa;mCAAb,aAAa;2CADtC,MAAM;kCAEU,yBAAyB;+BAAzB,yBAAyB;kCAAzB,yBAAyB;iCADhB,aAAa"}
|
package/src/utils/address.js
CHANGED
|
@@ -5,6 +5,7 @@ import bs58 from 'bs58';
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @import {IBCConnectionID} from '@agoric/vats';
|
|
8
|
+
* @import {Address as EvmAddress} from 'viem';
|
|
8
9
|
* @import {Bech32Address, CosmosChainAddress, CaipChainId} from '../types.js';
|
|
9
10
|
* @import {AccountId, AccountIdArg, Caip10Record} from '../orchestration-api.js';
|
|
10
11
|
* @import {RemoteIbcAddress} from '@agoric/vats/tools/ibc-utils.js';
|
|
@@ -117,6 +118,16 @@ export const getBech32Prefix = address => {
|
|
|
117
118
|
return address.slice(0, split);
|
|
118
119
|
};
|
|
119
120
|
|
|
121
|
+
/**
|
|
122
|
+
* Compare two EVM addresses for equality, case-insensitive.
|
|
123
|
+
*
|
|
124
|
+
* @param {EvmAddress} a
|
|
125
|
+
* @param {EvmAddress} b
|
|
126
|
+
* @returns {boolean}
|
|
127
|
+
*/
|
|
128
|
+
export const sameEvmAddress = (a, b) => a.toLowerCase() === b.toLowerCase();
|
|
129
|
+
harden(sameEvmAddress);
|
|
130
|
+
|
|
120
131
|
/**
|
|
121
132
|
* Coerce an AccountIdArg into a plain AccountId. The latter is now preferred so
|
|
122
133
|
* this utility can be used to adapt legacy calls, in particular from vows
|
package/src/utils/gmp.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export const gmpAddresses: {
|
|
|
15
15
|
AXELAR_GAS: Bech32Address;
|
|
16
16
|
OSMOSIS_RECEIVER: Bech32Address;
|
|
17
17
|
};
|
|
18
|
-
export function constructContractCall({ target, functionSignature, args }: ContractCall): AbiEncodedContractCall;
|
|
18
|
+
export function constructContractCall({ target, functionSignature, args, abi, }: ContractCall): AbiEncodedContractCall;
|
|
19
19
|
export function buildGMPPayload(contractCalls: ContractCall[], id?: string): number[];
|
|
20
20
|
export function buildNoncePayload(nonce: bigint): number[];
|
|
21
21
|
export function buildGasPayload(gasAmount: bigint): number[];
|
package/src/utils/gmp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,iFAHI,YAAY,GACV,sBAAsB,CA0BlC;AASM,+CAJI,YAAY,EAAE,OACd,MAAM,GACJ,MAAM,EAAE,CAkCpB;AAMM,yCAHI,MAAM,GACJ,MAAM,EAAE,CAMpB;AAMM,2CAHI,MAAM,GACJ,MAAM,EAAE,CASpB;;;;;;mCArH+B,uBAAuB;kCADA,oBAAoB;4CAApB,oBAAoB"}
|
package/src/utils/gmp.js
CHANGED
|
@@ -38,20 +38,26 @@ export const gmpAddresses = {
|
|
|
38
38
|
* @param {ContractCall} data - The data for the contract call.
|
|
39
39
|
* @returns {AbiEncodedContractCall} The encoded contract call object.
|
|
40
40
|
*/
|
|
41
|
-
export const constructContractCall = ({
|
|
41
|
+
export const constructContractCall = ({
|
|
42
|
+
target,
|
|
43
|
+
functionSignature,
|
|
44
|
+
args,
|
|
45
|
+
abi,
|
|
46
|
+
}) => {
|
|
42
47
|
const [name, paramsRaw] = functionSignature.split('(');
|
|
43
48
|
const params = paramsRaw.replace(')', '').split(',').filter(Boolean);
|
|
49
|
+
const resolvedAbi = abi ?? [
|
|
50
|
+
{
|
|
51
|
+
type: 'function',
|
|
52
|
+
name,
|
|
53
|
+
inputs: params.map((type, i) => ({ type, name: `arg${i}` })),
|
|
54
|
+
},
|
|
55
|
+
];
|
|
44
56
|
|
|
45
57
|
return {
|
|
46
58
|
target,
|
|
47
59
|
data: encodeFunctionData({
|
|
48
|
-
abi:
|
|
49
|
-
{
|
|
50
|
-
type: 'function',
|
|
51
|
-
name,
|
|
52
|
-
inputs: params.map((type, i) => ({ type, name: `arg${i}` })),
|
|
53
|
-
},
|
|
54
|
-
],
|
|
60
|
+
abi: resolvedAbi,
|
|
55
61
|
functionName: name,
|
|
56
62
|
args,
|
|
57
63
|
}),
|
|
@@ -68,9 +74,10 @@ export const constructContractCall = ({ target, functionSignature, args }) => {
|
|
|
68
74
|
export const buildGMPPayload = (contractCalls, id = '') => {
|
|
69
75
|
const abiEncodedContractCalls = [];
|
|
70
76
|
for (const call of contractCalls) {
|
|
71
|
-
const { target, functionSignature, args } = call;
|
|
77
|
+
const { target, functionSignature, args, abi } = call;
|
|
78
|
+
|
|
72
79
|
abiEncodedContractCalls.push(
|
|
73
|
-
constructContractCall({ target, functionSignature, args }),
|
|
80
|
+
constructContractCall({ target, functionSignature, args, abi }),
|
|
74
81
|
);
|
|
75
82
|
}
|
|
76
83
|
|