@agoric/orchestration 0.1.1-dev-a035bbe.0 → 0.1.1-dev-c244e96.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 +16 -16
- package/src/chain-info.js +1 -1
- package/src/examples/sendAnywhere.contract.d.ts.map +1 -1
- package/src/examples/sendAnywhere.contract.js +3 -2
- package/src/examples/stakeBld.contract.d.ts +23 -11
- package/src/examples/stakeBld.contract.d.ts.map +1 -1
- package/src/examples/stakeBld.contract.js +9 -5
- package/src/examples/stakeIca.contract.d.ts +3 -3
- package/src/examples/stakeIca.contract.js +1 -1
- package/src/examples/swapExample.contract.d.ts.map +1 -1
- package/src/examples/swapExample.contract.js +6 -1
- package/src/exos/{chainAccountKit.d.ts → chain-account-kit.d.ts} +1 -1
- package/src/exos/chain-account-kit.d.ts.map +1 -0
- package/src/exos/{chainAccountKit.js → chain-account-kit.js} +2 -2
- package/src/exos/{cosmosOrchestrationAccount.d.ts → cosmos-orchestration-account.d.ts} +1 -1
- package/src/exos/cosmos-orchestration-account.d.ts.map +1 -0
- package/src/exos/{icqConnectionKit.d.ts → icq-connection-kit.d.ts} +1 -1
- package/src/exos/icq-connection-kit.d.ts.map +1 -0
- package/src/exos/local-chain-facade.d.ts +105 -0
- package/src/exos/local-chain-facade.d.ts.map +1 -0
- package/src/exos/local-chain-facade.js +67 -0
- package/src/exos/{local-chain-account-kit.d.ts → local-orchestration-account.d.ts} +33 -63
- package/src/exos/{local-chain-account-kit.d.ts.map → local-orchestration-account.d.ts.map} +1 -1
- package/src/exos/{local-chain-account-kit.js → local-orchestration-account.js} +48 -30
- package/src/exos/orchestrator.d.ts +4763 -0
- package/src/exos/orchestrator.d.ts.map +1 -0
- package/src/exos/orchestrator.js +93 -0
- package/src/exos/remote-chain-facade.d.ts +84 -0
- package/src/exos/remote-chain-facade.d.ts.map +1 -0
- package/src/exos/remote-chain-facade.js +81 -0
- package/src/facade.d.ts +88 -4
- package/src/facade.d.ts.map +1 -1
- package/src/facade.js +30 -169
- package/src/proposals/start-stakeAtom.d.ts +3 -3
- package/src/proposals/start-stakeAtom.d.ts.map +1 -1
- package/src/proposals/start-stakeBld.d.ts +23 -11
- package/src/proposals/start-stakeBld.d.ts.map +1 -1
- package/src/proposals/start-stakeOsmo.d.ts +3 -3
- package/src/proposals/start-stakeOsmo.d.ts.map +1 -1
- package/src/service.js +3 -3
- package/src/typeGuards.d.ts +14 -0
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +15 -0
- package/src/types.d.ts +2 -2
- package/src/types.d.ts.map +1 -1
- package/src/types.ts +2 -2
- package/src/utils/chainHub.d.ts +15 -3
- package/src/utils/chainHub.d.ts.map +1 -1
- package/src/utils/chainHub.js +1 -1
- package/src/utils/orc.js +2 -2
- package/src/utils/orchestrationAccount.js +3 -4
- package/src/utils/start-helper.d.ts +9 -0
- package/src/utils/start-helper.d.ts.map +1 -1
- package/src/utils/start-helper.js +32 -3
- package/src/exos/chainAccountKit.d.ts.map +0 -1
- package/src/exos/cosmosOrchestrationAccount.d.ts.map +0 -1
- package/src/exos/icqConnectionKit.d.ts.map +0 -1
- /package/src/exos/{cosmosOrchestrationAccount.js → cosmos-orchestration-account.js} +0 -0
- /package/src/exos/{icqConnectionKit.js → icq-connection-kit.js} +0 -0
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-c244e96.0+c244e96",
|
|
4
4
|
"description": "Chain abstraction for Agoric's orchestration clients",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -32,20 +32,20 @@
|
|
|
32
32
|
},
|
|
33
33
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@agoric/assert": "0.6.1-dev-
|
|
36
|
-
"@agoric/async-flow": "0.1.1-dev-
|
|
37
|
-
"@agoric/cosmic-proto": "0.4.1-dev-
|
|
38
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
39
|
-
"@agoric/internal": "0.3.3-dev-
|
|
40
|
-
"@agoric/network": "0.1.1-dev-
|
|
41
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
42
|
-
"@agoric/store": "0.9.3-dev-
|
|
43
|
-
"@agoric/time": "0.3.3-dev-
|
|
44
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
45
|
-
"@agoric/vats": "0.15.2-dev-
|
|
46
|
-
"@agoric/vow": "0.1.1-dev-
|
|
47
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
48
|
-
"@agoric/zone": "0.2.3-dev-
|
|
35
|
+
"@agoric/assert": "0.6.1-dev-c244e96.0+c244e96",
|
|
36
|
+
"@agoric/async-flow": "0.1.1-dev-c244e96.0+c244e96",
|
|
37
|
+
"@agoric/cosmic-proto": "0.4.1-dev-c244e96.0+c244e96",
|
|
38
|
+
"@agoric/ertp": "0.16.3-dev-c244e96.0+c244e96",
|
|
39
|
+
"@agoric/internal": "0.3.3-dev-c244e96.0+c244e96",
|
|
40
|
+
"@agoric/network": "0.1.1-dev-c244e96.0+c244e96",
|
|
41
|
+
"@agoric/notifier": "0.6.3-dev-c244e96.0+c244e96",
|
|
42
|
+
"@agoric/store": "0.9.3-dev-c244e96.0+c244e96",
|
|
43
|
+
"@agoric/time": "0.3.3-dev-c244e96.0+c244e96",
|
|
44
|
+
"@agoric/vat-data": "0.5.3-dev-c244e96.0+c244e96",
|
|
45
|
+
"@agoric/vats": "0.15.2-dev-c244e96.0+c244e96",
|
|
46
|
+
"@agoric/vow": "0.1.1-dev-c244e96.0+c244e96",
|
|
47
|
+
"@agoric/zoe": "0.26.3-dev-c244e96.0+c244e96",
|
|
48
|
+
"@agoric/zone": "0.2.3-dev-c244e96.0+c244e96",
|
|
49
49
|
"@endo/base64": "^1.0.5",
|
|
50
50
|
"@endo/far": "^1.1.2",
|
|
51
51
|
"@endo/marshal": "^1.5.0",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"typeCoverage": {
|
|
89
89
|
"atLeast": 97.1
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "c244e96cc7736d1831acba2aa08b91050363fc83"
|
|
92
92
|
}
|
package/src/chain-info.js
CHANGED
|
@@ -10,7 +10,7 @@ import fetchedChainInfo from './fetched-chain-info.js';
|
|
|
10
10
|
const knownChains = /** @satisfies {Record<string, ChainInfo>} */ (
|
|
11
11
|
harden({
|
|
12
12
|
...fetchedChainInfo,
|
|
13
|
-
//
|
|
13
|
+
// FIXME does not have useful connections
|
|
14
14
|
// UNTIL https://github.com/Agoric/agoric-sdk/issues/9492
|
|
15
15
|
agoriclocal: {
|
|
16
16
|
chainId: 'agoriclocal',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendAnywhere.contract.d.ts","sourceRoot":"","sources":["sendAnywhere.contract.js"],"names":[],"mappings":"AAYA;;;;;;;;GAQG;AAEH;;;;;;;;GAQG;AAEH,kEAKE;AASK,2BANI,GAAG,eACH,mBAAmB,GAAG;IAChC,UAAc,EAAE,UAAU,CAAC;CACxB;;;;;
|
|
1
|
+
{"version":3,"file":"sendAnywhere.contract.d.ts","sourceRoot":"","sources":["sendAnywhere.contract.js"],"names":[],"mappings":"AAYA;;;;;;;;GAQG;AAEH;;;;;;;;GAQG;AAEH,kEAKE;AASK,2BANI,GAAG,eACH,mBAAmB,GAAG;IAChC,UAAc,EAAE,UAAU,CAAC;CACxB;;;;;QAuFE;;;WAGG;;;;;;;;;;GAgBR;;;;;8BA1CG,MACA,KACH,CAAC;6BAsBuC,QAClC,KAAG,CAAC,mBAA6B,OAAO;6BAkBuC,OAAO,KAAK,CAAC;;;2BAA6rB,EAAE;;;;;;;oBAAqjG,CAAC;;;uBAA6lB,EAAE;;;;;;;;;;;;;;;;;6BAzI75I,kBAAkB;uCACS,eAAe;4BAK3C,aAAa;kCAJK,cAAc;6BAG/B,cAAc"}
|
|
@@ -52,6 +52,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
52
52
|
privateArgs.marshaller,
|
|
53
53
|
);
|
|
54
54
|
|
|
55
|
+
/** @type {import('../orchestration-api.js').OrchestrationAccount<any>} */
|
|
55
56
|
let contractAccount;
|
|
56
57
|
|
|
57
58
|
const findBrandInVBank = async brand => {
|
|
@@ -79,7 +80,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
79
80
|
const { denom } = await findBrandInVBank(amt.brand);
|
|
80
81
|
const chain = await orch.getChain(chainName);
|
|
81
82
|
|
|
82
|
-
//
|
|
83
|
+
// FIXME ok to use a heap var crossing the membrane scope this way?
|
|
83
84
|
if (!contractAccount) {
|
|
84
85
|
const agoricChain = await orch.getChain('agoric');
|
|
85
86
|
contractAccount = await agoricChain.makeAccount();
|
|
@@ -88,7 +89,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
88
89
|
const info = await chain.getChainInfo();
|
|
89
90
|
const { chainId } = info;
|
|
90
91
|
const { [kw]: pmtP } = await withdrawFromSeat(zcf, seat, give);
|
|
91
|
-
await E.when(pmtP, pmt => contractAccount.deposit(pmt
|
|
92
|
+
await E.when(pmtP, pmt => contractAccount.deposit(pmt));
|
|
92
93
|
await contractAccount.transfer(
|
|
93
94
|
{ denom, value: amt.value },
|
|
94
95
|
{
|
|
@@ -35,7 +35,7 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
35
35
|
publicSubscribers: {
|
|
36
36
|
account: {
|
|
37
37
|
description: string;
|
|
38
|
-
subscriber: globalThis.Subscriber<import("../exos/local-
|
|
38
|
+
subscriber: globalThis.Subscriber<import("../exos/local-orchestration-account.js").LocalChainAccountNotification>;
|
|
39
39
|
storagePath: Promise<string>;
|
|
40
40
|
};
|
|
41
41
|
};
|
|
@@ -47,10 +47,12 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
47
47
|
CloseAccount(): never;
|
|
48
48
|
}>;
|
|
49
49
|
account: import("@endo/exo").Guarded<{
|
|
50
|
+
getBalance(denom: DenomArg): Promise<import("../orchestration-api.js").DenomAmount>;
|
|
51
|
+
getBalances(): never;
|
|
50
52
|
getPublicTopics(): {
|
|
51
53
|
account: {
|
|
52
54
|
description: string;
|
|
53
|
-
subscriber: globalThis.Subscriber<import("../exos/local-
|
|
55
|
+
subscriber: globalThis.Subscriber<import("../exos/local-orchestration-account.js").LocalChainAccountNotification>;
|
|
54
56
|
storagePath: Promise<string>;
|
|
55
57
|
};
|
|
56
58
|
};
|
|
@@ -58,20 +60,24 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
58
60
|
'@type': "/cosmos.staking.v1beta1.MsgDelegateResponse";
|
|
59
61
|
}>>;
|
|
60
62
|
undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<void>;
|
|
61
|
-
deposit(payment: Payment<"nat"
|
|
63
|
+
deposit(payment: globalThis.Payment<"nat">): Promise<void>;
|
|
62
64
|
withdraw(amount: Amount<"nat">): import("@agoric/vow").PromiseVow<globalThis.Payment<"nat">>;
|
|
63
65
|
executeTx<MT extends {
|
|
64
66
|
'@type': string;
|
|
65
67
|
}[]>(messages: MT): import("@agoric/vats/src/localchain.js").PromiseVowOfTupleMappedToGenerics<{ [K in keyof MT]: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto").ResponseTo<MT[K]>>; }>;
|
|
66
|
-
getAddress():
|
|
68
|
+
getAddress(): import("../orchestration-api.js").ChainAddress;
|
|
69
|
+
send(toAccount: any, amount: any): Promise<void>;
|
|
67
70
|
transfer(amount: import("../orchestration-api.js").AmountArg, destination: import("../orchestration-api.js").ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): Promise<void>;
|
|
71
|
+
transferSteps(amount: AmountArg, msg: TransferMsg): Promise<void>;
|
|
68
72
|
}>;
|
|
69
73
|
}, undefined>>;
|
|
70
74
|
makeAccount(): Promise<import("@endo/exo").Guarded<{
|
|
75
|
+
getBalance(denom: DenomArg): Promise<import("../orchestration-api.js").DenomAmount>;
|
|
76
|
+
getBalances(): never;
|
|
71
77
|
getPublicTopics(): {
|
|
72
78
|
account: {
|
|
73
79
|
description: string;
|
|
74
|
-
subscriber: globalThis.Subscriber<import("../exos/local-
|
|
80
|
+
subscriber: globalThis.Subscriber<import("../exos/local-orchestration-account.js").LocalChainAccountNotification>;
|
|
75
81
|
storagePath: Promise<string>;
|
|
76
82
|
};
|
|
77
83
|
};
|
|
@@ -79,13 +85,15 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
79
85
|
'@type': "/cosmos.staking.v1beta1.MsgDelegateResponse";
|
|
80
86
|
}>>;
|
|
81
87
|
undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<void>;
|
|
82
|
-
deposit(payment: Payment<"nat"
|
|
88
|
+
deposit(payment: globalThis.Payment<"nat">): Promise<void>;
|
|
83
89
|
withdraw(amount: Amount<"nat">): import("@agoric/vow").PromiseVow<globalThis.Payment<"nat">>;
|
|
84
90
|
executeTx<MT extends {
|
|
85
91
|
'@type': string;
|
|
86
92
|
}[]>(messages: MT): import("@agoric/vats/src/localchain.js").PromiseVowOfTupleMappedToGenerics<{ [K in keyof MT]: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto").ResponseTo<MT[K]>>; }>;
|
|
87
|
-
getAddress():
|
|
93
|
+
getAddress(): import("../orchestration-api.js").ChainAddress;
|
|
94
|
+
send(toAccount: any, amount: any): Promise<void>;
|
|
88
95
|
transfer(amount: import("../orchestration-api.js").AmountArg, destination: import("../orchestration-api.js").ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): Promise<void>;
|
|
96
|
+
transferSteps(amount: AmountArg, msg: TransferMsg): Promise<void>;
|
|
89
97
|
}>>;
|
|
90
98
|
/**
|
|
91
99
|
* Invitation to make an account, without any funds
|
|
@@ -94,7 +102,7 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
94
102
|
publicSubscribers: {
|
|
95
103
|
account: {
|
|
96
104
|
description: string;
|
|
97
|
-
subscriber: globalThis.Subscriber<import("../exos/local-
|
|
105
|
+
subscriber: globalThis.Subscriber<import("../exos/local-orchestration-account.js").LocalChainAccountNotification>;
|
|
98
106
|
storagePath: Promise<string>;
|
|
99
107
|
};
|
|
100
108
|
};
|
|
@@ -106,10 +114,12 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
106
114
|
CloseAccount(): never;
|
|
107
115
|
}>;
|
|
108
116
|
account: import("@endo/exo").Guarded<{
|
|
117
|
+
getBalance(denom: DenomArg): Promise<import("../orchestration-api.js").DenomAmount>;
|
|
118
|
+
getBalances(): never;
|
|
109
119
|
getPublicTopics(): {
|
|
110
120
|
account: {
|
|
111
121
|
description: string;
|
|
112
|
-
subscriber: globalThis.Subscriber<import("../exos/local-
|
|
122
|
+
subscriber: globalThis.Subscriber<import("../exos/local-orchestration-account.js").LocalChainAccountNotification>;
|
|
113
123
|
storagePath: Promise<string>;
|
|
114
124
|
};
|
|
115
125
|
};
|
|
@@ -117,13 +127,15 @@ export function start(zcf: ZCF, privateArgs: {
|
|
|
117
127
|
'@type': "/cosmos.staking.v1beta1.MsgDelegateResponse";
|
|
118
128
|
}>>;
|
|
119
129
|
undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<void>;
|
|
120
|
-
deposit(payment: Payment<"nat"
|
|
130
|
+
deposit(payment: globalThis.Payment<"nat">): Promise<void>;
|
|
121
131
|
withdraw(amount: Amount<"nat">): import("@agoric/vow").PromiseVow<globalThis.Payment<"nat">>;
|
|
122
132
|
executeTx<MT extends {
|
|
123
133
|
'@type': string;
|
|
124
134
|
}[]>(messages: MT): import("@agoric/vats/src/localchain.js").PromiseVowOfTupleMappedToGenerics<{ [K in keyof MT]: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto").ResponseTo<MT[K]>>; }>;
|
|
125
|
-
getAddress():
|
|
135
|
+
getAddress(): import("../orchestration-api.js").ChainAddress;
|
|
136
|
+
send(toAccount: any, amount: any): Promise<void>;
|
|
126
137
|
transfer(amount: import("../orchestration-api.js").AmountArg, destination: import("../orchestration-api.js").ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): Promise<void>;
|
|
138
|
+
transferSteps(amount: AmountArg, msg: TransferMsg): Promise<void>;
|
|
127
139
|
}>;
|
|
128
140
|
}, undefined>>;
|
|
129
141
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stakeBld.contract.d.ts","sourceRoot":"","sources":["stakeBld.contract.js"],"names":[],"mappings":"AAmCO,2BAVI,GAAG;;;;;
|
|
1
|
+
{"version":3,"file":"stakeBld.contract.d.ts","sourceRoot":"","sources":["stakeBld.contract.js"],"names":[],"mappings":"AAmCO,2BAVI,GAAG;;;;;8BA2EJ,MAAA,KAAK,CAAC;6BAmBA,QAAO,KAAK,CAAC,mBAA6B,OAAO;6BAawP,OAAO,KAAK,CAAC;;;2BAA6rB,EAAE;;;;;;;oBAAqjG,CAAC;;;uBAA6lB,EAAE;;;;;gBAvGzoJ,UAAU;iBACT,WAAW;;YAGlB,OAAO,kBAAkB,EAAE,OAAO;;QA+CvC;;WAEG;;;;;;;;;;+DA2BsC,OAAO,KACnD,CAAC;;;iEAaU,OAAO,KAAK,CAAC;;;;kCASulB,QAAS;;;;;;;;;+DAAiyB,OAAO,KAAK,CAAC;;;iEAA+yB,OAAO,KAAK,CAAC;;iCAA56D,OAAO,KAAK,CAAC;;;+BAA6rB,EAAE;;;;sCAA46B,SAAU,OAAM,WAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;QApBv8D;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiBR;6BAnHyB,cAAc;4BACf,kBAAkB;kCACZ,cAAc"}
|
|
@@ -10,7 +10,7 @@ import { V } from '@agoric/vow/vat.js';
|
|
|
10
10
|
import { E } from '@endo/far';
|
|
11
11
|
import { deeplyFulfilled } from '@endo/marshal';
|
|
12
12
|
import { M } from '@endo/patterns';
|
|
13
|
-
import {
|
|
13
|
+
import { prepareLocalOrchestrationAccountKit } from '../exos/local-orchestration-account.js';
|
|
14
14
|
import { makeChainHub } from '../utils/chainHub.js';
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -41,7 +41,7 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
41
41
|
privateArgs.marshaller,
|
|
42
42
|
);
|
|
43
43
|
|
|
44
|
-
const
|
|
44
|
+
const makeLocalOrchestrationAccountKit = prepareLocalOrchestrationAccountKit(
|
|
45
45
|
zone,
|
|
46
46
|
makeRecorderKit,
|
|
47
47
|
zcf,
|
|
@@ -58,10 +58,14 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
58
58
|
async function makeLocalAccountKit() {
|
|
59
59
|
const account = await V(privateArgs.localchain).makeAccount();
|
|
60
60
|
const address = await V(account).getAddress();
|
|
61
|
-
//
|
|
62
|
-
return
|
|
61
|
+
// FIXME 'address' is implied by 'account'; use an async maker that get the value itself
|
|
62
|
+
return makeLocalOrchestrationAccountKit({
|
|
63
63
|
account,
|
|
64
|
-
address
|
|
64
|
+
address: harden({
|
|
65
|
+
address,
|
|
66
|
+
addressEncoding: 'bech32',
|
|
67
|
+
chainId: 'local',
|
|
68
|
+
}),
|
|
65
69
|
storageNode: privateArgs.storageNode,
|
|
66
70
|
});
|
|
67
71
|
}
|
|
@@ -31,7 +31,7 @@ export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
|
31
31
|
publicSubscribers: {
|
|
32
32
|
account: {
|
|
33
33
|
description: string;
|
|
34
|
-
subscriber: globalThis.Subscriber<import("../exos/
|
|
34
|
+
subscriber: globalThis.Subscriber<import("../exos/cosmos-orchestration-account.js").ComosOrchestrationAccountNotification>;
|
|
35
35
|
storagePath: Promise<string>;
|
|
36
36
|
};
|
|
37
37
|
};
|
|
@@ -48,7 +48,7 @@ export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
|
48
48
|
getPublicTopics(): {
|
|
49
49
|
account: {
|
|
50
50
|
description: string;
|
|
51
|
-
subscriber: globalThis.Subscriber<import("../exos/
|
|
51
|
+
subscriber: globalThis.Subscriber<import("../exos/cosmos-orchestration-account.js").ComosOrchestrationAccountNotification>;
|
|
52
52
|
storagePath: Promise<string>;
|
|
53
53
|
};
|
|
54
54
|
};
|
|
@@ -69,7 +69,7 @@ export function start(zcf: ZCF<StakeIcaTerms>, privateArgs: {
|
|
|
69
69
|
publicSubscribers: {
|
|
70
70
|
account: {
|
|
71
71
|
description: string;
|
|
72
|
-
subscriber: globalThis.Subscriber<import("../exos/
|
|
72
|
+
subscriber: globalThis.Subscriber<import("../exos/cosmos-orchestration-account.js").ComosOrchestrationAccountNotification>;
|
|
73
73
|
storagePath: Promise<string>;
|
|
74
74
|
};
|
|
75
75
|
};
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import { InvitationShape } from '@agoric/zoe/src/typeGuards.js';
|
|
11
11
|
import { makeDurableZone } from '@agoric/zone/durable.js';
|
|
12
12
|
import { M } from '@endo/patterns';
|
|
13
|
-
import { prepareCosmosOrchestrationAccount } from '../exos/
|
|
13
|
+
import { prepareCosmosOrchestrationAccount } from '../exos/cosmos-orchestration-account.js';
|
|
14
14
|
|
|
15
15
|
const trace = makeTracer('StakeAtom');
|
|
16
16
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swapExample.contract.d.ts","sourceRoot":"","sources":["swapExample.contract.js"],"names":[],"mappings":"AASA;;;;;;;;GAQG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAWnC;AASK,0CAHI,KAAK;;;EAIsC;AAc/C,2BAXI,GAAG;;;;;
|
|
1
|
+
{"version":3,"file":"swapExample.contract.d.ts","sourceRoot":"","sources":["swapExample.contract.js"],"names":[],"mappings":"AASA;;;;;;;;GAQG;AAEH,yCAAyC;AACzC,mBADW,YAAY,CAAC,OAAO,KAAK,CAAC,CAWnC;AASK,0CAHI,KAAK;;;EAIsC;AAc/C,2BAXI,GAAG;;;;;8BAgE+D,MAAM,KAAK,CAAC;6BAkBvD,QAAQ,KAAK,CAAC,mBACxC,OACL;6BAuBoB,OAAO,KAC7B,CAAC;;;2BAC0rB,EAAE;;;;;;;oBAAqjG,CAAC;;;uBAA6lB,EAAE;;;;;;;;;;;;;;;gBAtGl0I,UAAU;;;;oBAiCV,MAAM,CAAC,KAAK,CAAC;;;;;oBAAb,MAAM,CAAC,KAAK,CAAC;;;;GAoE7B;6BAvIyB,cAAc;4BAHf,kBAAkB;gCAHwB,aAAa;kCACjD,cAAc;6BAInB,kBAAkB;4CALuB,aAAa"}
|
|
@@ -103,7 +103,12 @@ export const start = async (zcf, privateArgs, baggage) => {
|
|
|
103
103
|
|
|
104
104
|
// deposit funds from user seat to LocalChainAccount
|
|
105
105
|
const payments = await withdrawFromSeat(zcf, seat, give);
|
|
106
|
-
await deeplyFulfilled(
|
|
106
|
+
await deeplyFulfilled(
|
|
107
|
+
objectMap(payments, payment =>
|
|
108
|
+
// @ts-expect-error payment is ERef<Payment> which happens to work but isn't officially supported
|
|
109
|
+
localAccount.deposit(payment),
|
|
110
|
+
),
|
|
111
|
+
);
|
|
107
112
|
seat.exit();
|
|
108
113
|
|
|
109
114
|
// build swap instructions with orcUtils library
|
|
@@ -68,4 +68,4 @@ import type { ChainAddress } from '../types.js';
|
|
|
68
68
|
import type { TxBody } from '@agoric/cosmic-proto/cosmos/tx/v1beta1/tx.js';
|
|
69
69
|
import type { Connection } from '@agoric/network';
|
|
70
70
|
import type { Remote } from '@agoric/vow';
|
|
71
|
-
//# sourceMappingURL=
|
|
71
|
+
//# sourceMappingURL=chain-account-kit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain-account-kit.d.ts","sourceRoot":"","sources":["chain-account-kit.js"],"names":[],"mappings":"AA8BA;;;;;;;;;;;GAaG;AAeI;;QAqBC,8BAA8B;;;;;;;;QAiC9B;;;;;;;;;WASG;mLAHU,OAAO,CAAC,MAAM,CAAC;QAa5B,+BAA+B;;QAS/B;;;;WAIG;wBADQ,KAAK;;;QAQhB;;;;WAIG;;;;;GAyBR;qCAzJW,0BAA0B;;aAoB1B,MAAM;;;;4BAIS,MAAM;;;;8BAmIrB,UAAU,CAAC,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;0BAvK5C,mBAAmB;0BACP,iBAAiB;kCAKrB,aAAa;4BAFnB,8CAA8C;gCAHpC,iBAAiB;4BAC3B,aAAa"}
|
|
@@ -131,7 +131,7 @@ export const prepareChainAccountKit = zone =>
|
|
|
131
131
|
},
|
|
132
132
|
/** Close the remote account */
|
|
133
133
|
async close() {
|
|
134
|
-
|
|
134
|
+
// FIXME what should the behavior be here? and `onClose`?
|
|
135
135
|
// - retrieve assets?
|
|
136
136
|
// - revoke the port?
|
|
137
137
|
const { connection } = this.state;
|
|
@@ -169,7 +169,7 @@ export const prepareChainAccountKit = zone =>
|
|
|
169
169
|
},
|
|
170
170
|
async onClose(_connection, reason) {
|
|
171
171
|
trace(`ICA Channel closed. Reason: ${reason}`);
|
|
172
|
-
//
|
|
172
|
+
// FIXME handle connection closing
|
|
173
173
|
// XXX is there a scenario where a connection will unexpectedly close? _I think yes_
|
|
174
174
|
},
|
|
175
175
|
async onReceive(connection, bytes) {
|
|
@@ -183,4 +183,4 @@ import type { CosmosValidatorAddress } from '../types.js';
|
|
|
183
183
|
import type { DenomAmount } from '../types.js';
|
|
184
184
|
import type { Delegation } from '@agoric/cosmic-proto/cosmos/staking/v1beta1/staking.js';
|
|
185
185
|
import type { DenomArg } from '../types.js';
|
|
186
|
-
//# sourceMappingURL=
|
|
186
|
+
//# sourceMappingURL=cosmos-orchestration-account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cosmos-orchestration-account.d.ts","sourceRoot":"","sources":["cosmos-orchestration-account.js"],"names":[],"mappings":"AAmDA;;;GAGG;AAEH;;;;;;;;;GASG;AAEH,mCAAmC;AACnC;;;;;;;;;;;;;;;GAqBG;AAOH,6CAGE;AAgBK,mGAgCsB,WAAW,GACnC,QAAI,OAAO,WAAW,EAAE,MAAM,CAAC,WACnC,CAAC,CAAC,0HApCQ,GAAG;;;;;;;;;;;QAuDN,wDAAwD;;;QAWxD;;;WAGG;;;;QAgBH;;;WAGG;;QASH;;;;WAIG;;QAaH,gDAAgD;;QAShD,kEAAkE;;;QAYlE;;;;WAIG;;;;;;;;;;;;;gBAtDH;;;mBAGG;;gBASH;;;;mBAIG;;gBAaH,gDAAgD;;gBAShD,kEAAkE;;;gBAYlE;;;;mBAIG;;;;;;;;;;;;QA2BH,8BAA8B;;QAI9B;;;;;WAKG;;;;QA2BH;;;;;;WAMG;;QAmBH;;;WAGG;;QAmBH;;;WAGG;;;;;;QA4CH,kEAAkE;;;GAgCzE;AAkBM,0IAvTsB,MAAM,wIAgTxB,GAAG,GACD,CACZ,GAAO,IAAI,EAAE,UAAU,CACvB,UAAgB,CAAC,OAAO,oCAAoC,CAAC,CACxD,KACE,6BAA6B,CAAC,QAAQ,CAAC,CAa9C;;;;;;;;;;;;;eAxZe,MAAM;;;4CA8XT,UAAU,CACtB,UAAc,CAAC,OAAO,oCAAoC,CAAC,CACxD;yCAyBU,6BAA6B,CAAC,QAAQ,CAAC;0BA1a9B,cAAc;iCALU,6CAA6C;kCADsE,aAAa;gCAAb,aAAa;4BAItJ,kBAAkB;kCACZ,cAAc;+BALqH,aAAa;0BAExJ,kDAAkD;4CAFyF,aAAa;iCAAb,aAAa;gCAGlJ,wDAAwD;8BAH6E,aAAa"}
|
|
@@ -41,4 +41,4 @@ import type { JsonSafe } from '@agoric/cosmic-proto';
|
|
|
41
41
|
import type { ResponseQuery } from '@agoric/cosmic-proto/tendermint/abci/types.js';
|
|
42
42
|
import type { Connection } from '@agoric/network';
|
|
43
43
|
import type { Remote } from '@agoric/vow';
|
|
44
|
-
//# sourceMappingURL=
|
|
44
|
+
//# sourceMappingURL=icq-connection-kit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icq-connection-kit.d.ts","sourceRoot":"","sources":["icq-connection-kit.js"],"names":[],"mappings":"AAoBA,2DAGE;AAEF;;;;GAIG;AA0BI;;;;QA4BC;;;;WAIG;;;;QAYH;;;;WAIG;;;;;GAgBR;;;;;;;+BAEW,UAAU,CAAC,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;4BACtD,gBAAgB,CAAC,YAAY,CAAC;0BAjHrB,mBAAmB;0BACP,iBAAiB;kCAGN,+CAA+C;8BADlE,sBAAsB;mCACH,+CAA+C;gCAH1D,iBAAiB;4BAC3B,aAAa"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
export function prepareLocalChainFacade(zone: Zone, { makeLocalOrchestrationAccountKit, localchain, storageNode }: {
|
|
2
|
+
makeLocalOrchestrationAccountKit: (args_0: {
|
|
3
|
+
account: import("@endo/exo").Guarded<{
|
|
4
|
+
getAddress(): string;
|
|
5
|
+
getBalance(brand: Brand<"nat">): import("@agoric/vow").PromiseVow<import("@agoric/ertp/src/types.js").NatAmount>;
|
|
6
|
+
deposit(payment: Payment<"nat">, optAmountShape?: Pattern): import("@agoric/vow").PromiseVow<import("@agoric/ertp/src/types.js").NatAmount>;
|
|
7
|
+
withdraw(amount: Amount<"nat">): import("@agoric/vow").PromiseVow<globalThis.Payment<"nat">>;
|
|
8
|
+
executeTx<MT extends {
|
|
9
|
+
'@type': string;
|
|
10
|
+
}[]>(messages: MT): import("@agoric/vats/src/localchain.js").PromiseVowOfTupleMappedToGenerics<{ [K in keyof MT]: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto").ResponseTo<MT[K]>>; }>;
|
|
11
|
+
monitorTransfers(tap: import("@agoric/vats/src/bridge-target.js").TargetApp): import("@agoric/vow").PromiseVow<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
12
|
+
}>;
|
|
13
|
+
address: import("../orchestration-api.js").ChainAddress;
|
|
14
|
+
storageNode: Remote<globalThis.StorageNode>;
|
|
15
|
+
}) => import("@endo/exo").GuardedKit<{
|
|
16
|
+
invitationMakers: {
|
|
17
|
+
Delegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Invitation<import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto/cosmos/staking/v1beta1/tx.js").MsgDelegateResponse & {
|
|
18
|
+
'@type': "/cosmos.staking.v1beta1.MsgDelegateResponse";
|
|
19
|
+
}>, undefined>>;
|
|
20
|
+
Undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<Invitation<void, undefined>>;
|
|
21
|
+
CloseAccount(): never;
|
|
22
|
+
};
|
|
23
|
+
holder: {
|
|
24
|
+
getBalance(denom: DenomArg): Promise<import("../orchestration-api.js").DenomAmount>;
|
|
25
|
+
getBalances(): never;
|
|
26
|
+
getPublicTopics(): {
|
|
27
|
+
account: {
|
|
28
|
+
description: string;
|
|
29
|
+
subscriber: globalThis.Subscriber<import("./local-orchestration-account.js").LocalChainAccountNotification>;
|
|
30
|
+
storagePath: Promise<string>;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
delegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto/cosmos/staking/v1beta1/tx.js").MsgDelegateResponse & {
|
|
34
|
+
'@type': "/cosmos.staking.v1beta1.MsgDelegateResponse";
|
|
35
|
+
}>>;
|
|
36
|
+
undelegate(validatorAddress: string, ertpAmount: Amount<"nat">): Promise<void>;
|
|
37
|
+
deposit(payment: globalThis.Payment<"nat">): Promise<void>;
|
|
38
|
+
withdraw(amount: Amount<"nat">): import("@agoric/vow").PromiseVow<globalThis.Payment<"nat">>;
|
|
39
|
+
executeTx<MT extends {
|
|
40
|
+
'@type': string;
|
|
41
|
+
}[]>(messages: MT): import("@agoric/vats/src/localchain.js").PromiseVowOfTupleMappedToGenerics<{ [K in keyof MT]: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto").ResponseTo<MT[K]>>; }>;
|
|
42
|
+
getAddress(): import("../orchestration-api.js").ChainAddress;
|
|
43
|
+
send(toAccount: any, amount: any): Promise<void>;
|
|
44
|
+
transfer(amount: import("../orchestration-api.js").AmountArg, destination: import("../orchestration-api.js").ChainAddress, opts?: import("../cosmos-api.js").IBCMsgTransferOptions | undefined): Promise<void>;
|
|
45
|
+
transferSteps(amount: AmountArg, msg: TransferMsg): Promise<void>;
|
|
46
|
+
};
|
|
47
|
+
}>;
|
|
48
|
+
orchestration: Remote<import("@endo/exo").Guarded<{
|
|
49
|
+
makeAccount(chainId: string, hostConnectionId: `connection-${number}`, controllerConnectionId: `connection-${number}`): Promise<import("../cosmos-api.js").IcaAccount>;
|
|
50
|
+
provideICQConnection(controllerConnectionId: `connection-${number}`): Promise<import("@endo/exo").Guarded<{
|
|
51
|
+
getLocalAddress(): `/ibc-port/${string}`;
|
|
52
|
+
getRemoteAddress(): `/${string}ibc-port/${string}/ordered/${string}` | `/${string}ibc-port/${string}/unordered/${string}`;
|
|
53
|
+
query(msgs: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto/tendermint/abci/types.js").RequestQuery>[]): Promise<import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto/tendermint/abci/types.js").ResponseQuery>[]>;
|
|
54
|
+
}>>;
|
|
55
|
+
}>>;
|
|
56
|
+
storageNode: Remote<globalThis.StorageNode>;
|
|
57
|
+
timer: Remote<TimerService>;
|
|
58
|
+
localchain: Remote<import("@endo/exo").Guarded<{
|
|
59
|
+
makeAccount(): import("@agoric/vow").PromiseVow<import("@endo/exo").Guarded<{
|
|
60
|
+
getAddress(): string;
|
|
61
|
+
getBalance(brand: Brand<"nat">): import("@agoric/vow").PromiseVow<import("@agoric/ertp/src/types.js").NatAmount>;
|
|
62
|
+
deposit(payment: Payment<"nat">, optAmountShape?: Pattern): import("@agoric/vow").PromiseVow<import("@agoric/ertp/src/types.js").NatAmount>;
|
|
63
|
+
withdraw(amount: Amount<"nat">): import("@agoric/vow").PromiseVow<globalThis.Payment<"nat">>;
|
|
64
|
+
executeTx<MT extends {
|
|
65
|
+
'@type': string;
|
|
66
|
+
}[]>(messages: MT): import("@agoric/vats/src/localchain.js").PromiseVowOfTupleMappedToGenerics<{ [K in keyof MT]: import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto").ResponseTo<MT[K]>>; }>;
|
|
67
|
+
monitorTransfers(tap: import("@agoric/vats/src/bridge-target.js").TargetApp): import("@agoric/vow").PromiseVow<import("@agoric/vats/src/bridge-target.js").TargetRegistration>;
|
|
68
|
+
}>>;
|
|
69
|
+
query<T extends {
|
|
70
|
+
'@type': string;
|
|
71
|
+
} = {
|
|
72
|
+
'@type': string;
|
|
73
|
+
}>(request: T): import("@agoric/vow").PromiseVow<import("@agoric/cosmic-proto").JsonSafe<import("@agoric/cosmic-proto").ResponseTo<T>>>;
|
|
74
|
+
queryMany<RT extends {
|
|
75
|
+
'@type': string;
|
|
76
|
+
}[]>(requests: RT): import("@agoric/vats/src/localchain.js").PromiseVowOfTupleMappedToGenerics<{ [K_1 in keyof RT]: import("@agoric/cosmic-proto").JsonSafe<{
|
|
77
|
+
error?: string | undefined;
|
|
78
|
+
reply: import("@agoric/cosmic-proto").ResponseTo<RT[K_1]>;
|
|
79
|
+
}>; }>;
|
|
80
|
+
}>>;
|
|
81
|
+
}): (localChainInfo: Readonly<{
|
|
82
|
+
chainId: string;
|
|
83
|
+
connections?: Record<string, IBCConnectionInfo> | undefined;
|
|
84
|
+
icqEnabled?: boolean | undefined;
|
|
85
|
+
stakingTokens?: readonly {
|
|
86
|
+
denom: string;
|
|
87
|
+
}[] | undefined;
|
|
88
|
+
}>) => import("@endo/exo").Guarded<{
|
|
89
|
+
getChainInfo(): Promise<Readonly<{
|
|
90
|
+
chainId: string;
|
|
91
|
+
connections?: Record<string, IBCConnectionInfo> | undefined;
|
|
92
|
+
icqEnabled?: boolean | undefined;
|
|
93
|
+
stakingTokens?: readonly {
|
|
94
|
+
denom: string;
|
|
95
|
+
}[] | undefined;
|
|
96
|
+
}>>;
|
|
97
|
+
/** @returns {Promise<OrchestrationAccount<ChainInfo>>} */
|
|
98
|
+
makeAccount(): Promise<import("../orchestration-api.js").OrchestrationAccountI>;
|
|
99
|
+
}>;
|
|
100
|
+
export type MakeLocalChainFacade = ReturnType<typeof prepareLocalChainFacade>;
|
|
101
|
+
import type { Zone } from '@agoric/base-zone';
|
|
102
|
+
import type { Remote } from '@agoric/internal';
|
|
103
|
+
import type { TimerService } from '@agoric/time';
|
|
104
|
+
import type { IBCConnectionInfo } from '../types.js';
|
|
105
|
+
//# sourceMappingURL=local-chain-facade.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-chain-facade.d.ts","sourceRoot":"","sources":["local-chain-facade.js"],"names":[],"mappings":"AAyBO;;;;8BA0C6pC,MAAM,KAAK,CAAC;6BAA6gB,QAAQ,KAAK,CAAC,mBAA6B,OAAO;6BAAwjB,OAAO,KAAK,CAAC;;;2BAA6rB,EAAE;;;;;;;2DAAxlD,OAAO,KAAK,CAAC;;;6DAAid,OAAO,KAAK,CAAC;;;;8BAA0tB,QAAS;;;;;;;;;2DAAiyB,OAAO,KAAK,CAAC;;;6DAA+yB,OAAO,KAAK,CAAC;;6BAA56D,OAAO,KAAK,CAAC;;;2BAA6rB,EAAE;;;;kCAA46B,SAAU,OAAM,WAAY;;;;;;;;;;;;;;;;8BAAvxF,MAAM,KAAK,CAAC;6BAA6gB,QAAQ,KAAK,CAAC,mBAA6B,OAAO;6BAAwjB,OAAO,KAAK,CAAC;;;2BAA6rB,EAAE;;;;;;;oBAAqjG,CAAC;;;uBAA6lB,EAAE;;;;;;;;;;;;;;;;;;;;;IAtBloN,0DAA0D;;GAmB7D;mCAEW,UAAU,CAAC,OAAO,uBAAuB,CAAC;0BA5DjC,mBAAmB;4BAEjB,kBAAkB;kCADZ,cAAc;uCAKyC,aAAa"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/** @file ChainAccount exo */
|
|
2
|
+
import { V } from '@agoric/vow/vat.js';
|
|
3
|
+
|
|
4
|
+
import { ChainFacadeI } from '../typeGuards.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @import {Zone} from '@agoric/base-zone';
|
|
8
|
+
* @import {TimerService} from '@agoric/time';
|
|
9
|
+
* @import {Remote} from '@agoric/internal';
|
|
10
|
+
* @import {LocalChain} from '@agoric/vats/src/localchain.js';
|
|
11
|
+
* @import {OrchestrationService} from '../service.js';
|
|
12
|
+
* @import {MakeLocalOrchestrationAccountKit} from './local-orchestration-account.js';
|
|
13
|
+
* @import {ChainInfo, CosmosChainInfo, IBCConnectionInfo, OrchestrationAccount} from '../types.js';
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @param {Zone} zone
|
|
18
|
+
* @param {{
|
|
19
|
+
* makeLocalOrchestrationAccountKit: MakeLocalOrchestrationAccountKit;
|
|
20
|
+
* orchestration: Remote<OrchestrationService>;
|
|
21
|
+
* storageNode: Remote<StorageNode>;
|
|
22
|
+
* timer: Remote<TimerService>;
|
|
23
|
+
* localchain: Remote<LocalChain>;
|
|
24
|
+
* }} powers
|
|
25
|
+
*/
|
|
26
|
+
export const prepareLocalChainFacade = (
|
|
27
|
+
zone,
|
|
28
|
+
{ makeLocalOrchestrationAccountKit, localchain, storageNode },
|
|
29
|
+
) =>
|
|
30
|
+
zone.exoClass(
|
|
31
|
+
'LocalChainFacade',
|
|
32
|
+
ChainFacadeI,
|
|
33
|
+
/**
|
|
34
|
+
* @param {CosmosChainInfo} localChainInfo
|
|
35
|
+
*/
|
|
36
|
+
localChainInfo => {
|
|
37
|
+
return { localChainInfo };
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
async getChainInfo() {
|
|
41
|
+
return this.state.localChainInfo;
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
// FIXME parameterize on the remoteChainInfo to make()
|
|
45
|
+
// That used to work but got lost in the migration to Exo
|
|
46
|
+
/** @returns {Promise<OrchestrationAccount<ChainInfo>>} */
|
|
47
|
+
async makeAccount() {
|
|
48
|
+
const { localChainInfo } = this.state;
|
|
49
|
+
const lcaP = V(localchain).makeAccount();
|
|
50
|
+
const [lca, address] = await Promise.all([lcaP, V(lcaP).getAddress()]);
|
|
51
|
+
const { holder: account } = makeLocalOrchestrationAccountKit({
|
|
52
|
+
account: lca,
|
|
53
|
+
address: harden({
|
|
54
|
+
address,
|
|
55
|
+
chainId: localChainInfo.chainId,
|
|
56
|
+
addressEncoding: 'bech32',
|
|
57
|
+
}),
|
|
58
|
+
// FIXME storage path
|
|
59
|
+
storageNode,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
return account;
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
);
|
|
66
|
+
harden(prepareLocalChainFacade);
|
|
67
|
+
/** @typedef {ReturnType<typeof prepareLocalChainFacade>} MakeLocalChainFacade */
|