@medialane/sdk 0.166.0 → 0.168.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/dist/{chunk-USFXQO4T.js → chunk-3QGECZBS.js} +44 -2
- package/dist/chunk-3QGECZBS.js.map +1 -0
- package/dist/{chunk-TPONHUAU.cjs → chunk-BILJIXSP.cjs} +44 -2
- package/dist/chunk-BILJIXSP.cjs.map +1 -0
- package/dist/{errors-DRiTDrwm.d.ts → errors-CWbsAodQ.d.ts} +102 -2
- package/dist/{errors-GcSzVvZL.d.cts → errors-CwqwX-vA.d.cts} +102 -2
- package/dist/evm/index.d.cts +1 -1
- package/dist/evm/index.d.ts +1 -1
- package/dist/index.cjs +77 -73
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/solana/index.d.cts +1 -1
- package/dist/solana/index.d.ts +1 -1
- package/dist/starknet/index.cjs +100 -113
- package/dist/starknet/index.cjs.map +1 -1
- package/dist/starknet/index.d.cts +20 -7
- package/dist/starknet/index.d.ts +20 -7
- package/dist/starknet/index.js +34 -47
- package/dist/starknet/index.js.map +1 -1
- package/dist/stellar/index.d.cts +1 -1
- package/dist/stellar/index.d.ts +1 -1
- package/dist/{types-PPshMWr7.d.cts → types-C-y68Ut2.d.cts} +3 -1
- package/dist/{types-PPshMWr7.d.ts → types-C-y68Ut2.d.ts} +3 -1
- package/package.json +1 -1
- package/dist/chunk-TPONHUAU.cjs.map +0 -1
- package/dist/chunk-USFXQO4T.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { bS as ResolvedConfig, b5 as CreatePopCollectionParams, bZ as TxResult, aK as ClaimConditions, aZ as CreateDropParams, bc as CreateTicketParams, bC as MintTicketsParams, b1 as CreateMembershipParams, bB as MintMembershipsParams, b9 as CreateSponsorshipOfferParams, bP as ProposeSponsorshipParams, k as ApiClient, bz as MedialaneConfig, bA as MedialaneErrorCode, bH as OrderDetails, R as ResolvedFeeConfig, I as ApiFundingIntent, H as ApiFundingInstructions, L as ApiFundingSubmit, N as ApiIntentCreated, c4 as SealedOwner, c5 as ReceiptProviderLike, c6 as WalletExecutor, c7 as ExecutedTransaction, c8 as PasskeyOwner, bh as CreateWalletManageIntentParams, c9 as CreatedOwner } from '../errors-CwqwX-vA.cjs';
|
|
2
|
+
export { ca as InvalidRecoveryKeyError, cb as OwnerSigner, bK as PasskeyCancelledError, cc as PasskeyConfig, bL as PasskeyUnsupportedError, bM as PasskeyUnsupportedReason, cd as RecoveryKey, b$ as UserFacingError, ce as createPasskeyOwner, cf as encodeRecoveryKey, cg as parseRecoveryKey } from '../errors-CwqwX-vA.cjs';
|
|
3
3
|
import { AccountInterface, ProviderInterface, Call, TypedData, constants, BigNumberish, DeployAccountContractPayload, Account } from 'starknet';
|
|
4
|
-
import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-
|
|
4
|
+
import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-C-y68Ut2.cjs';
|
|
5
5
|
import 'zod';
|
|
6
6
|
|
|
7
7
|
declare class PopService {
|
|
@@ -501,8 +501,14 @@ type FundingResult = {
|
|
|
501
501
|
intentId: string;
|
|
502
502
|
reason: string;
|
|
503
503
|
};
|
|
504
|
-
|
|
504
|
+
type FundWithTransferOptions = ({
|
|
505
|
+
amount: string;
|
|
506
|
+
amountUsdc?: never;
|
|
507
|
+
} | {
|
|
505
508
|
amountUsdc: string;
|
|
509
|
+
amount?: never;
|
|
510
|
+
}) & FundWithTransferRest;
|
|
511
|
+
interface FundWithTransferRest {
|
|
506
512
|
onStep?: (step: FundingStep) => void;
|
|
507
513
|
pollMs?: number;
|
|
508
514
|
maxPolls?: number;
|
|
@@ -8255,6 +8261,7 @@ interface TypedDataSigner {
|
|
|
8255
8261
|
interface SponsoredExecuteConfig {
|
|
8256
8262
|
proxyUrl: string;
|
|
8257
8263
|
fetchImpl?: typeof fetch;
|
|
8264
|
+
headers?: Record<string, string>;
|
|
8258
8265
|
}
|
|
8259
8266
|
type SponsoredExecuteResult = {
|
|
8260
8267
|
status: "sponsored";
|
|
@@ -8267,7 +8274,7 @@ declare class SponsoredCallRejectedError extends Error {
|
|
|
8267
8274
|
}
|
|
8268
8275
|
type SponsorshipFailureCode = "sponsor_unavailable" | "credits_exhausted" | "account_not_deployed" | "not_executable" | "invalid_request" | "not_authorized" | "rate_limited" | "may_have_broadcast";
|
|
8269
8276
|
declare function allowsFallbackFunding(code: string | undefined, status: number, stage: "build" | "execute"): boolean;
|
|
8270
|
-
declare function executeSponsored(config: SponsoredExecuteConfig, signer: TypedDataSigner, calls: Call[]): Promise<SponsoredExecuteResult>;
|
|
8277
|
+
declare function executeSponsored(config: SponsoredExecuteConfig, signer: TypedDataSigner, calls: Call[], intentIds?: string[]): Promise<SponsoredExecuteResult>;
|
|
8271
8278
|
|
|
8272
8279
|
declare function encodeByteArray(str: string): string[];
|
|
8273
8280
|
|
|
@@ -8472,6 +8479,10 @@ interface MediaWalletConfig {
|
|
|
8472
8479
|
backendUrl?: string;
|
|
8473
8480
|
deployProxyUrl?: string;
|
|
8474
8481
|
fetchImpl?: typeof fetch;
|
|
8482
|
+
walletIntents?: (params: CreateWalletManageIntentParams) => Promise<{
|
|
8483
|
+
id: string;
|
|
8484
|
+
calls: Call[];
|
|
8485
|
+
}>;
|
|
8475
8486
|
}
|
|
8476
8487
|
interface MediaWallet {
|
|
8477
8488
|
store: OwnerStore;
|
|
@@ -8480,11 +8491,13 @@ interface MediaWallet {
|
|
|
8480
8491
|
signerFor(sealed: SealedOwner): {
|
|
8481
8492
|
address: string;
|
|
8482
8493
|
signTypedData(data: TypedData): Promise<string[]>;
|
|
8483
|
-
execute(calls: Call[]
|
|
8494
|
+
execute(calls: Call[], opts?: {
|
|
8495
|
+
intentIds?: string[];
|
|
8496
|
+
}): Promise<{
|
|
8484
8497
|
txHash: string;
|
|
8485
8498
|
}>;
|
|
8486
8499
|
};
|
|
8487
|
-
run(sealed: SealedOwner, calls: Call[], userAddress?: string): Promise<ExecutedTransaction>;
|
|
8500
|
+
run(sealed: SealedOwner, calls: Call[], userAddress?: string, intentIds?: string[]): Promise<ExecutedTransaction>;
|
|
8488
8501
|
getGuardians(address: string): Promise<GuardianInfo[]>;
|
|
8489
8502
|
getEscape(address: string): Promise<EscapeInfo>;
|
|
8490
8503
|
getEscapeSecurityPeriod(address: string): Promise<number>;
|
package/dist/starknet/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { bS as ResolvedConfig, b5 as CreatePopCollectionParams, bZ as TxResult, aK as ClaimConditions, aZ as CreateDropParams, bc as CreateTicketParams, bC as MintTicketsParams, b1 as CreateMembershipParams, bB as MintMembershipsParams, b9 as CreateSponsorshipOfferParams, bP as ProposeSponsorshipParams, k as ApiClient, bz as MedialaneConfig, bA as MedialaneErrorCode, bH as OrderDetails, R as ResolvedFeeConfig, I as ApiFundingIntent, H as ApiFundingInstructions, L as ApiFundingSubmit, N as ApiIntentCreated, c4 as SealedOwner, c5 as ReceiptProviderLike, c6 as WalletExecutor, c7 as ExecutedTransaction, c8 as PasskeyOwner, bh as CreateWalletManageIntentParams, c9 as CreatedOwner } from '../errors-CWbsAodQ.js';
|
|
2
|
+
export { ca as InvalidRecoveryKeyError, cb as OwnerSigner, bK as PasskeyCancelledError, cc as PasskeyConfig, bL as PasskeyUnsupportedError, bM as PasskeyUnsupportedReason, cd as RecoveryKey, b$ as UserFacingError, ce as createPasskeyOwner, cf as encodeRecoveryKey, cg as parseRecoveryKey } from '../errors-CWbsAodQ.js';
|
|
3
3
|
import { AccountInterface, ProviderInterface, Call, TypedData, constants, BigNumberish, DeployAccountContractPayload, Account } from 'starknet';
|
|
4
|
-
import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-
|
|
4
|
+
import { V as VenueAdapter, O as OrderRef, A as AdapterTxResult, R as RegisterOrderParams, j as VenueSigner } from '../types-C-y68Ut2.js';
|
|
5
5
|
import 'zod';
|
|
6
6
|
|
|
7
7
|
declare class PopService {
|
|
@@ -501,8 +501,14 @@ type FundingResult = {
|
|
|
501
501
|
intentId: string;
|
|
502
502
|
reason: string;
|
|
503
503
|
};
|
|
504
|
-
|
|
504
|
+
type FundWithTransferOptions = ({
|
|
505
|
+
amount: string;
|
|
506
|
+
amountUsdc?: never;
|
|
507
|
+
} | {
|
|
505
508
|
amountUsdc: string;
|
|
509
|
+
amount?: never;
|
|
510
|
+
}) & FundWithTransferRest;
|
|
511
|
+
interface FundWithTransferRest {
|
|
506
512
|
onStep?: (step: FundingStep) => void;
|
|
507
513
|
pollMs?: number;
|
|
508
514
|
maxPolls?: number;
|
|
@@ -8255,6 +8261,7 @@ interface TypedDataSigner {
|
|
|
8255
8261
|
interface SponsoredExecuteConfig {
|
|
8256
8262
|
proxyUrl: string;
|
|
8257
8263
|
fetchImpl?: typeof fetch;
|
|
8264
|
+
headers?: Record<string, string>;
|
|
8258
8265
|
}
|
|
8259
8266
|
type SponsoredExecuteResult = {
|
|
8260
8267
|
status: "sponsored";
|
|
@@ -8267,7 +8274,7 @@ declare class SponsoredCallRejectedError extends Error {
|
|
|
8267
8274
|
}
|
|
8268
8275
|
type SponsorshipFailureCode = "sponsor_unavailable" | "credits_exhausted" | "account_not_deployed" | "not_executable" | "invalid_request" | "not_authorized" | "rate_limited" | "may_have_broadcast";
|
|
8269
8276
|
declare function allowsFallbackFunding(code: string | undefined, status: number, stage: "build" | "execute"): boolean;
|
|
8270
|
-
declare function executeSponsored(config: SponsoredExecuteConfig, signer: TypedDataSigner, calls: Call[]): Promise<SponsoredExecuteResult>;
|
|
8277
|
+
declare function executeSponsored(config: SponsoredExecuteConfig, signer: TypedDataSigner, calls: Call[], intentIds?: string[]): Promise<SponsoredExecuteResult>;
|
|
8271
8278
|
|
|
8272
8279
|
declare function encodeByteArray(str: string): string[];
|
|
8273
8280
|
|
|
@@ -8472,6 +8479,10 @@ interface MediaWalletConfig {
|
|
|
8472
8479
|
backendUrl?: string;
|
|
8473
8480
|
deployProxyUrl?: string;
|
|
8474
8481
|
fetchImpl?: typeof fetch;
|
|
8482
|
+
walletIntents?: (params: CreateWalletManageIntentParams) => Promise<{
|
|
8483
|
+
id: string;
|
|
8484
|
+
calls: Call[];
|
|
8485
|
+
}>;
|
|
8475
8486
|
}
|
|
8476
8487
|
interface MediaWallet {
|
|
8477
8488
|
store: OwnerStore;
|
|
@@ -8480,11 +8491,13 @@ interface MediaWallet {
|
|
|
8480
8491
|
signerFor(sealed: SealedOwner): {
|
|
8481
8492
|
address: string;
|
|
8482
8493
|
signTypedData(data: TypedData): Promise<string[]>;
|
|
8483
|
-
execute(calls: Call[]
|
|
8494
|
+
execute(calls: Call[], opts?: {
|
|
8495
|
+
intentIds?: string[];
|
|
8496
|
+
}): Promise<{
|
|
8484
8497
|
txHash: string;
|
|
8485
8498
|
}>;
|
|
8486
8499
|
};
|
|
8487
|
-
run(sealed: SealedOwner, calls: Call[], userAddress?: string): Promise<ExecutedTransaction>;
|
|
8500
|
+
run(sealed: SealedOwner, calls: Call[], userAddress?: string, intentIds?: string[]): Promise<ExecutedTransaction>;
|
|
8488
8501
|
getGuardians(address: string): Promise<GuardianInfo[]>;
|
|
8489
8502
|
getEscape(address: string): Promise<EscapeInfo>;
|
|
8490
8503
|
getEscapeSecurityPeriod(address: string): Promise<number>;
|
package/dist/starknet/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { normalizeAddress, collectionHref, resolveConfig, ApiClient, UserFacingError, getService, STARKNET_MEDIAWALLET_CLASS_HASH, computeAccountAddress, ownerConstructorCalldata, getTokenBySymbol, signWithPrivateKey, stringifyBigInts, SUPPORTED_TOKENS, starkKeyPairFromPrivateKey, createFailoverFetch } from '../chunk-
|
|
2
|
-
export { InvalidStarkPrivateKeyError, PasskeyCancelledError, PasskeyUnsupportedError, UserFacingError, computeAccountAddress, createPasskeyOwner, deriveAesKey, generateStarkKeyPair, ownerConstructorCalldata, sealPrivateKey, signWithPrivateKey, starkKeyPairFromPrivateKey, unsealPrivateKey } from '../chunk-
|
|
1
|
+
import { normalizeAddress, collectionHref, resolveConfig, ApiClient, UserFacingError, getService, STARKNET_MEDIAWALLET_CLASS_HASH, computeAccountAddress, ownerConstructorCalldata, getTokenBySymbol, signWithPrivateKey, stringifyBigInts, SUPPORTED_TOKENS, starkKeyPairFromPrivateKey, createFailoverFetch } from '../chunk-3QGECZBS.js';
|
|
2
|
+
export { InvalidStarkPrivateKeyError, PasskeyCancelledError, PasskeyUnsupportedError, UserFacingError, computeAccountAddress, createPasskeyOwner, deriveAesKey, generateStarkKeyPair, ownerConstructorCalldata, sealPrivateKey, signWithPrivateKey, starkKeyPairFromPrivateKey, unsealPrivateKey } from '../chunk-3QGECZBS.js';
|
|
3
3
|
import { getStarknetCoordinates, getCoordinates } from '../chunk-PBJLHXDB.js';
|
|
4
4
|
import { hash, cairo, uint256, RpcProvider, CairoOption, CairoOptionVariant, num, ec, validateAndParseAddress, Account, typedData, stark, CallData, byteArray, Contract, TypedDataRevision, constants, shortString } from 'starknet';
|
|
5
5
|
import { extract, expand } from '@noble/hashes/hkdf.js';
|
|
@@ -11238,7 +11238,8 @@ async function fundWithChainTransfer(api, wallet, options) {
|
|
|
11238
11238
|
const pollMs = options.pollMs ?? 3e3;
|
|
11239
11239
|
const maxPolls = options.maxPolls ?? 20;
|
|
11240
11240
|
step("creating");
|
|
11241
|
-
const
|
|
11241
|
+
const params = options.amount !== void 0 ? { amount: options.amount } : { amountUsdc: options.amountUsdc };
|
|
11242
|
+
const { data: intent } = await api.createFunding({ method: "chain-transfer", params });
|
|
11242
11243
|
let txHash;
|
|
11243
11244
|
let transferStarted = false;
|
|
11244
11245
|
try {
|
|
@@ -11316,7 +11317,7 @@ async function executeIntent(provider, signer, client, intent, opts = {}) {
|
|
|
11316
11317
|
} else {
|
|
11317
11318
|
calls = intent.calls;
|
|
11318
11319
|
}
|
|
11319
|
-
const { txHash } = await signer.execute(calls);
|
|
11320
|
+
const { txHash } = await signer.execute(calls, { intentIds: [intent.id] });
|
|
11320
11321
|
const receipt = await assertTransactionSucceeded(provider, txHash);
|
|
11321
11322
|
await Promise.all([
|
|
11322
11323
|
syncTransactionBestEffort(client, txHash),
|
|
@@ -11329,7 +11330,7 @@ async function executeIntents(provider, signer, client, intents, opts = {}) {
|
|
|
11329
11330
|
throw new Error("Expected prebuilt intents (requiresSignature=false)");
|
|
11330
11331
|
}
|
|
11331
11332
|
const calls = intents.flatMap((i) => i.calls);
|
|
11332
|
-
const { txHash } = await signer.execute(calls);
|
|
11333
|
+
const { txHash } = await signer.execute(calls, { intentIds: intents.map((i) => i.id) });
|
|
11333
11334
|
const receipt = await assertTransactionSucceeded(provider, txHash);
|
|
11334
11335
|
await Promise.all([
|
|
11335
11336
|
syncTransactionBestEffort(client, txHash),
|
|
@@ -11391,14 +11392,14 @@ async function failureOf(res, fallback) {
|
|
|
11391
11392
|
const body = await res.json().catch(() => null);
|
|
11392
11393
|
return { reason: body?.error || fallback, code: typeof body?.code === "string" ? body.code : void 0 };
|
|
11393
11394
|
}
|
|
11394
|
-
async function executeSponsored(config, signer, calls) {
|
|
11395
|
+
async function executeSponsored(config, signer, calls, intentIds) {
|
|
11395
11396
|
const doFetch = config.fetchImpl ?? fetch;
|
|
11396
11397
|
const base = config.proxyUrl.replace(/\/$/, "");
|
|
11397
|
-
const headers = { "Content-Type": "application/json" };
|
|
11398
|
+
const headers = { "Content-Type": "application/json", ...config.headers };
|
|
11398
11399
|
const buildRes = await doFetch(`${base}/build`, {
|
|
11399
11400
|
method: "POST",
|
|
11400
11401
|
headers,
|
|
11401
|
-
body: JSON.stringify({ userAddress: signer.address, calls })
|
|
11402
|
+
body: JSON.stringify(intentIds ? { intentIds } : { userAddress: signer.address, calls })
|
|
11402
11403
|
});
|
|
11403
11404
|
if (!buildRes.ok) {
|
|
11404
11405
|
const { reason, code } = await failureOf(buildRes, "We couldn't prepare this transaction.");
|
|
@@ -11410,7 +11411,7 @@ async function executeSponsored(config, signer, calls) {
|
|
|
11410
11411
|
const executeRes = await doFetch(`${base}/execute`, {
|
|
11411
11412
|
method: "POST",
|
|
11412
11413
|
headers,
|
|
11413
|
-
body: JSON.stringify({ userAddress: signer.address, typedData, signature, calls })
|
|
11414
|
+
body: JSON.stringify(intentIds ? { intentIds, typedData, signature } : { userAddress: signer.address, typedData, signature, calls })
|
|
11414
11415
|
});
|
|
11415
11416
|
if (!executeRes.ok) {
|
|
11416
11417
|
const { reason, code } = await failureOf(executeRes, "We couldn't submit this transaction.");
|
|
@@ -11791,14 +11792,15 @@ function sponsoredExecutor(deps) {
|
|
|
11791
11792
|
const fallback = deps.fallback ?? selfFundedExecutor(deps);
|
|
11792
11793
|
return {
|
|
11793
11794
|
async execute(input) {
|
|
11794
|
-
const { userAddress, privateKeyHex, calls } = input;
|
|
11795
|
+
const { userAddress, privateKeyHex, calls, intentIds } = input;
|
|
11795
11796
|
const result = await executeSponsored(
|
|
11796
11797
|
{ proxyUrl: deps.proxyUrl, fetchImpl: deps.fetchImpl },
|
|
11797
11798
|
{
|
|
11798
11799
|
address: userAddress,
|
|
11799
11800
|
signTypedData: async (data) => signWithPrivateKey(privateKeyHex, typedData.getMessageHash(data, userAddress))
|
|
11800
11801
|
},
|
|
11801
|
-
calls
|
|
11802
|
+
calls,
|
|
11803
|
+
intentIds
|
|
11802
11804
|
);
|
|
11803
11805
|
if (result.status === "sponsored") return { transactionHash: result.transactionHash };
|
|
11804
11806
|
const consented = await deps.consent.request({ address: userAddress, calls });
|
|
@@ -12012,14 +12014,25 @@ function createMediaWallet(config) {
|
|
|
12012
12014
|
unlockCache.set(sealed.address, { promise, timer });
|
|
12013
12015
|
return promise;
|
|
12014
12016
|
};
|
|
12015
|
-
const run = async (sealed, calls, userAddress) => {
|
|
12017
|
+
const run = async (sealed, calls, userAddress, intentIds) => {
|
|
12016
12018
|
const privateKeyHex = await unlockOnce(sealed);
|
|
12017
12019
|
return config.executor.execute({
|
|
12018
12020
|
userAddress: userAddress ?? sealed.address,
|
|
12019
12021
|
privateKeyHex,
|
|
12020
|
-
calls
|
|
12022
|
+
calls,
|
|
12023
|
+
intentIds
|
|
12021
12024
|
});
|
|
12022
12025
|
};
|
|
12026
|
+
const walletIntents = config.walletIntents ?? (async (params) => {
|
|
12027
|
+
if (!config.backendUrl) throw new Error("This wallet has no backend url configured");
|
|
12028
|
+
const created = await new ApiClient(config.backendUrl).createWalletManageIntent(params);
|
|
12029
|
+
return created.data;
|
|
12030
|
+
});
|
|
12031
|
+
const manage = async (sealed, params) => {
|
|
12032
|
+
const intent = await walletIntents(params);
|
|
12033
|
+
const { transactionHash } = await run(sealed, intent.calls, params.owner, [intent.id]);
|
|
12034
|
+
return transactionHash;
|
|
12035
|
+
};
|
|
12023
12036
|
return {
|
|
12024
12037
|
store: config.store,
|
|
12025
12038
|
passkey: config.passkey,
|
|
@@ -12031,8 +12044,8 @@ function createMediaWallet(config) {
|
|
|
12031
12044
|
const privateKeyHex = await unlockOnce(sealed);
|
|
12032
12045
|
return signWithPrivateKey(privateKeyHex, typedData.getMessageHash(data, sealed.address));
|
|
12033
12046
|
},
|
|
12034
|
-
execute: async (calls) => {
|
|
12035
|
-
const { transactionHash } = await run(sealed, calls);
|
|
12047
|
+
execute: async (calls, opts) => {
|
|
12048
|
+
const { transactionHash } = await run(sealed, calls, void 0, opts?.intentIds);
|
|
12036
12049
|
return { txHash: transactionHash };
|
|
12037
12050
|
}
|
|
12038
12051
|
};
|
|
@@ -12047,38 +12060,12 @@ function createMediaWallet(config) {
|
|
|
12047
12060
|
const guid = BigInt(computeOwnerGuid(devicePubkey));
|
|
12048
12061
|
return owners.some((owner) => BigInt(owner.guid) === guid);
|
|
12049
12062
|
},
|
|
12050
|
-
|
|
12051
|
-
|
|
12052
|
-
|
|
12053
|
-
},
|
|
12054
|
-
|
|
12055
|
-
|
|
12056
|
-
guardianSealed,
|
|
12057
|
-
[buildTriggerEscapeOwnerCall(targetAddress, newOwnerPubkey)],
|
|
12058
|
-
normalizeWalletAddress(targetAddress)
|
|
12059
|
-
);
|
|
12060
|
-
return transactionHash;
|
|
12061
|
-
},
|
|
12062
|
-
async completeEscapeOwner(guardianSealed, targetAddress) {
|
|
12063
|
-
const { transactionHash } = await run(
|
|
12064
|
-
guardianSealed,
|
|
12065
|
-
[buildCompleteEscapeOwnerCall(targetAddress)],
|
|
12066
|
-
normalizeWalletAddress(targetAddress)
|
|
12067
|
-
);
|
|
12068
|
-
return transactionHash;
|
|
12069
|
-
},
|
|
12070
|
-
async cancelEscape(sealed) {
|
|
12071
|
-
const { transactionHash } = await run(sealed, [buildCancelEscapeCall(sealed.address)]);
|
|
12072
|
-
return transactionHash;
|
|
12073
|
-
},
|
|
12074
|
-
async addDevice(sealed, devicePubkey) {
|
|
12075
|
-
const { transactionHash } = await run(sealed, [buildAddOwnerCall(sealed.address, devicePubkey)]);
|
|
12076
|
-
return transactionHash;
|
|
12077
|
-
},
|
|
12078
|
-
async removeDevice(sealed, ownerGuid) {
|
|
12079
|
-
const { transactionHash } = await run(sealed, [buildRemoveOwnerByGuidCall(sealed.address, ownerGuid)]);
|
|
12080
|
-
return transactionHash;
|
|
12081
|
-
},
|
|
12063
|
+
setFirstGuardian: (sealed, guardianPubkey) => manage(sealed, { owner: sealed.address, action: "set_first_guardian", pubkey: guardianPubkey }),
|
|
12064
|
+
triggerEscapeOwner: (guardianSealed, targetAddress, newOwnerPubkey) => manage(guardianSealed, { owner: normalizeWalletAddress(targetAddress), action: "trigger_escape", newOwnerPubkey }),
|
|
12065
|
+
completeEscapeOwner: (guardianSealed, targetAddress) => manage(guardianSealed, { owner: normalizeWalletAddress(targetAddress), action: "complete_escape" }),
|
|
12066
|
+
cancelEscape: (sealed) => manage(sealed, { owner: sealed.address, action: "cancel_escape" }),
|
|
12067
|
+
addDevice: (sealed, devicePubkey) => manage(sealed, { owner: sealed.address, action: "add_owner", pubkey: devicePubkey }),
|
|
12068
|
+
removeDevice: (sealed, ownerGuid) => manage(sealed, { owner: sealed.address, action: "remove_owner", ownerGuid }),
|
|
12082
12069
|
completeDeployment: (onStep, options) => deployments.run(onStep, options),
|
|
12083
12070
|
isDeploying: () => deployments.isDeploying()
|
|
12084
12071
|
};
|