@opendatalabs/vana-sdk 3.2.0-canary.e3ef84a → 3.3.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/index.browser.d.ts +3 -4
- package/dist/index.browser.js +85 -245
- package/dist/index.browser.js.map +3 -3
- package/dist/index.node.cjs +88 -257
- package/dist/index.node.cjs.map +4 -4
- package/dist/index.node.d.ts +3 -4
- package/dist/index.node.js +85 -245
- package/dist/index.node.js.map +3 -3
- package/dist/protocol/eip712.cjs +14 -53
- package/dist/protocol/eip712.cjs.map +1 -1
- package/dist/protocol/eip712.d.ts +25 -97
- package/dist/protocol/eip712.js +12 -47
- package/dist/protocol/eip712.js.map +1 -1
- package/dist/protocol/gateway.cjs +10 -115
- package/dist/protocol/gateway.cjs.map +1 -1
- package/dist/protocol/gateway.d.ts +29 -196
- package/dist/protocol/gateway.js +10 -115
- package/dist/protocol/gateway.js.map +1 -1
- package/dist/protocol/grants.cjs +64 -24
- package/dist/protocol/grants.cjs.map +1 -1
- package/dist/protocol/grants.d.ts +13 -6
- package/dist/protocol/grants.js +63 -24
- package/dist/protocol/grants.js.map +1 -1
- package/package.json +2 -3
- package/dist/protocol/escrow-deposit.cjs +0 -89
- package/dist/protocol/escrow-deposit.cjs.map +0 -1
- package/dist/protocol/escrow-deposit.d.ts +0 -47
- package/dist/protocol/escrow-deposit.js +0 -60
- package/dist/protocol/escrow-deposit.js.map +0 -1
- package/dist/protocol/escrow-deposit.test.d.ts +0 -1
- package/dist/protocol/escrow-flow.test.d.ts +0 -21
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var escrow_deposit_exports = {};
|
|
20
|
-
__export(escrow_deposit_exports, {
|
|
21
|
-
ESCROW_DEPOSIT_ABI: () => ESCROW_DEPOSIT_ABI,
|
|
22
|
-
buildDepositNativeRequest: () => buildDepositNativeRequest,
|
|
23
|
-
buildDepositTokenRequest: () => buildDepositTokenRequest,
|
|
24
|
-
encodeDepositNativeData: () => encodeDepositNativeData,
|
|
25
|
-
encodeDepositTokenData: () => encodeDepositTokenData,
|
|
26
|
-
escrowContractAddress: () => escrowContractAddress
|
|
27
|
-
});
|
|
28
|
-
module.exports = __toCommonJS(escrow_deposit_exports);
|
|
29
|
-
var import_viem = require("viem");
|
|
30
|
-
const ESCROW_DEPOSIT_ABI = [
|
|
31
|
-
{
|
|
32
|
-
type: "function",
|
|
33
|
-
name: "depositNative",
|
|
34
|
-
stateMutability: "payable",
|
|
35
|
-
inputs: [{ name: "account", type: "address" }],
|
|
36
|
-
outputs: []
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
type: "function",
|
|
40
|
-
name: "depositToken",
|
|
41
|
-
stateMutability: "nonpayable",
|
|
42
|
-
inputs: [
|
|
43
|
-
{ name: "account", type: "address" },
|
|
44
|
-
{ name: "token", type: "address" },
|
|
45
|
-
{ name: "amount", type: "uint256" }
|
|
46
|
-
],
|
|
47
|
-
outputs: []
|
|
48
|
-
}
|
|
49
|
-
];
|
|
50
|
-
function escrowContractAddress(config) {
|
|
51
|
-
return config.contracts.dataPortabilityEscrow;
|
|
52
|
-
}
|
|
53
|
-
function encodeDepositNativeData(input) {
|
|
54
|
-
return (0, import_viem.encodeFunctionData)({
|
|
55
|
-
abi: ESCROW_DEPOSIT_ABI,
|
|
56
|
-
functionName: "depositNative",
|
|
57
|
-
args: [input.account]
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
function encodeDepositTokenData(input) {
|
|
61
|
-
return (0, import_viem.encodeFunctionData)({
|
|
62
|
-
abi: ESCROW_DEPOSIT_ABI,
|
|
63
|
-
functionName: "depositToken",
|
|
64
|
-
args: [input.account, input.token, input.amount]
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
function buildDepositNativeRequest(config, input) {
|
|
68
|
-
return {
|
|
69
|
-
to: escrowContractAddress(config),
|
|
70
|
-
data: encodeDepositNativeData({ account: input.account }),
|
|
71
|
-
value: input.amount
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
function buildDepositTokenRequest(config, input) {
|
|
75
|
-
return {
|
|
76
|
-
to: escrowContractAddress(config),
|
|
77
|
-
data: encodeDepositTokenData(input)
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
81
|
-
0 && (module.exports = {
|
|
82
|
-
ESCROW_DEPOSIT_ABI,
|
|
83
|
-
buildDepositNativeRequest,
|
|
84
|
-
buildDepositTokenRequest,
|
|
85
|
-
encodeDepositNativeData,
|
|
86
|
-
encodeDepositTokenData,
|
|
87
|
-
escrowContractAddress
|
|
88
|
-
});
|
|
89
|
-
//# sourceMappingURL=escrow-deposit.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/protocol/escrow-deposit.ts"],"sourcesContent":["/**\n * On-chain deposit primitives for the DataPortabilityEscrow contract.\n *\n * The escrow holds the finalized balance that `/v1/escrow/pay` debits against.\n * A payer credits their balance by sending one of two function calls to the\n * escrow contract — depositNative (native VANA, amount via `msg.value`) or\n * depositToken (ERC-20, caller must `approve` the escrow first). The credited\n * `account` need not equal `msg.sender`, so a third party can fund someone\n * else's escrow.\n *\n * Once the on-chain tx lands, call `GatewayClient.submitEscrowDeposit({txHash})`\n * to announce it; the gateway reconciles it into the balance and surfaces it\n * under `getEscrowBalance(account).deposits.finalized`.\n *\n * These helpers are signer/transport-agnostic — they return the raw\n * `{to, data, value?}` request object so callers can feed it to any wallet\n * stack (viem `sendTransaction`/`writeContract`, ethers, wallet-rpc, MPC,\n * Safe transactions, etc.).\n *\n * @category Protocol\n */\nimport { encodeFunctionData } from \"viem\";\nimport type { DataPortabilityGatewayConfig } from \"./eip712\";\n\n// ABI for the two deposit entry points on DataPortabilityEscrow. Same shape\n// the gateway uses to decode pending/mined tx calldata at\n// /v1/escrow/deposit time (data-gateway/lib/escrow.ts:39).\nexport const ESCROW_DEPOSIT_ABI = [\n {\n type: \"function\",\n name: \"depositNative\",\n stateMutability: \"payable\",\n inputs: [{ name: \"account\", type: \"address\" }],\n outputs: [],\n },\n {\n type: \"function\",\n name: \"depositToken\",\n stateMutability: \"nonpayable\",\n inputs: [\n { name: \"account\", type: \"address\" },\n { name: \"token\", type: \"address\" },\n { name: \"amount\", type: \"uint256\" },\n ],\n outputs: [],\n },\n] as const;\n\nexport function escrowContractAddress(\n config: DataPortabilityGatewayConfig,\n): `0x${string}` {\n return config.contracts.dataPortabilityEscrow as `0x${string}`;\n}\n\nexport interface DepositNativeInput {\n // Address credited inside the escrow. Often the same as the wallet sending\n // the tx, but third-party funding is supported.\n account: `0x${string}`;\n amount: bigint;\n}\n\nexport interface DepositTokenInput {\n account: `0x${string}`;\n // ERC-20 contract address.\n token: `0x${string}`;\n amount: bigint;\n}\n\n// Shape compatible with viem's `sendTransaction` / `writeContract` request\n// objects. `value` is omitted on the ERC-20 path because the amount lives in\n// the token contract, not `msg.value`.\nexport interface DepositTransactionRequest {\n to: `0x${string}`;\n data: `0x${string}`;\n value?: bigint;\n}\n\nexport function encodeDepositNativeData(input: {\n account: `0x${string}`;\n}): `0x${string}` {\n return encodeFunctionData({\n abi: ESCROW_DEPOSIT_ABI,\n functionName: \"depositNative\",\n args: [input.account],\n });\n}\n\nexport function encodeDepositTokenData(\n input: DepositTokenInput,\n): `0x${string}` {\n return encodeFunctionData({\n abi: ESCROW_DEPOSIT_ABI,\n functionName: \"depositToken\",\n args: [input.account, input.token, input.amount],\n });\n}\n\n// Build the full tx request for a native-VANA deposit. Feed it straight to\n// `walletClient.sendTransaction({...req, account, chain})`. ERC-20 needs a\n// prior `approve(escrow, amount)` on the token — use viem's built-in\n// `erc20Abi` for that; the SDK doesn't bundle one to avoid the import surface.\nexport function buildDepositNativeRequest(\n config: DataPortabilityGatewayConfig,\n input: DepositNativeInput,\n): DepositTransactionRequest {\n return {\n to: escrowContractAddress(config),\n data: encodeDepositNativeData({ account: input.account }),\n value: input.amount,\n };\n}\n\nexport function buildDepositTokenRequest(\n config: DataPortabilityGatewayConfig,\n input: DepositTokenInput,\n): DepositTransactionRequest {\n return {\n to: escrowContractAddress(config),\n data: encodeDepositTokenData(input),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBA,kBAAmC;AAM5B,MAAM,qBAAqB;AAAA,EAChC;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,iBAAiB;AAAA,IACjB,QAAQ,CAAC,EAAE,MAAM,WAAW,MAAM,UAAU,CAAC;AAAA,IAC7C,SAAS,CAAC;AAAA,EACZ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,iBAAiB;AAAA,IACjB,QAAQ;AAAA,MACN,EAAE,MAAM,WAAW,MAAM,UAAU;AAAA,MACnC,EAAE,MAAM,SAAS,MAAM,UAAU;AAAA,MACjC,EAAE,MAAM,UAAU,MAAM,UAAU;AAAA,IACpC;AAAA,IACA,SAAS,CAAC;AAAA,EACZ;AACF;AAEO,SAAS,sBACd,QACe;AACf,SAAO,OAAO,UAAU;AAC1B;AAyBO,SAAS,wBAAwB,OAEtB;AAChB,aAAO,gCAAmB;AAAA,IACxB,KAAK;AAAA,IACL,cAAc;AAAA,IACd,MAAM,CAAC,MAAM,OAAO;AAAA,EACtB,CAAC;AACH;AAEO,SAAS,uBACd,OACe;AACf,aAAO,gCAAmB;AAAA,IACxB,KAAK;AAAA,IACL,cAAc;AAAA,IACd,MAAM,CAAC,MAAM,SAAS,MAAM,OAAO,MAAM,MAAM;AAAA,EACjD,CAAC;AACH;AAMO,SAAS,0BACd,QACA,OAC2B;AAC3B,SAAO;AAAA,IACL,IAAI,sBAAsB,MAAM;AAAA,IAChC,MAAM,wBAAwB,EAAE,SAAS,MAAM,QAAQ,CAAC;AAAA,IACxD,OAAO,MAAM;AAAA,EACf;AACF;AAEO,SAAS,yBACd,QACA,OAC2B;AAC3B,SAAO;AAAA,IACL,IAAI,sBAAsB,MAAM;AAAA,IAChC,MAAM,uBAAuB,KAAK;AAAA,EACpC;AACF;","names":[]}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { DataPortabilityGatewayConfig } from "./eip712";
|
|
2
|
-
export declare const ESCROW_DEPOSIT_ABI: readonly [{
|
|
3
|
-
readonly type: "function";
|
|
4
|
-
readonly name: "depositNative";
|
|
5
|
-
readonly stateMutability: "payable";
|
|
6
|
-
readonly inputs: readonly [{
|
|
7
|
-
readonly name: "account";
|
|
8
|
-
readonly type: "address";
|
|
9
|
-
}];
|
|
10
|
-
readonly outputs: readonly [];
|
|
11
|
-
}, {
|
|
12
|
-
readonly type: "function";
|
|
13
|
-
readonly name: "depositToken";
|
|
14
|
-
readonly stateMutability: "nonpayable";
|
|
15
|
-
readonly inputs: readonly [{
|
|
16
|
-
readonly name: "account";
|
|
17
|
-
readonly type: "address";
|
|
18
|
-
}, {
|
|
19
|
-
readonly name: "token";
|
|
20
|
-
readonly type: "address";
|
|
21
|
-
}, {
|
|
22
|
-
readonly name: "amount";
|
|
23
|
-
readonly type: "uint256";
|
|
24
|
-
}];
|
|
25
|
-
readonly outputs: readonly [];
|
|
26
|
-
}];
|
|
27
|
-
export declare function escrowContractAddress(config: DataPortabilityGatewayConfig): `0x${string}`;
|
|
28
|
-
export interface DepositNativeInput {
|
|
29
|
-
account: `0x${string}`;
|
|
30
|
-
amount: bigint;
|
|
31
|
-
}
|
|
32
|
-
export interface DepositTokenInput {
|
|
33
|
-
account: `0x${string}`;
|
|
34
|
-
token: `0x${string}`;
|
|
35
|
-
amount: bigint;
|
|
36
|
-
}
|
|
37
|
-
export interface DepositTransactionRequest {
|
|
38
|
-
to: `0x${string}`;
|
|
39
|
-
data: `0x${string}`;
|
|
40
|
-
value?: bigint;
|
|
41
|
-
}
|
|
42
|
-
export declare function encodeDepositNativeData(input: {
|
|
43
|
-
account: `0x${string}`;
|
|
44
|
-
}): `0x${string}`;
|
|
45
|
-
export declare function encodeDepositTokenData(input: DepositTokenInput): `0x${string}`;
|
|
46
|
-
export declare function buildDepositNativeRequest(config: DataPortabilityGatewayConfig, input: DepositNativeInput): DepositTransactionRequest;
|
|
47
|
-
export declare function buildDepositTokenRequest(config: DataPortabilityGatewayConfig, input: DepositTokenInput): DepositTransactionRequest;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { encodeFunctionData } from "viem";
|
|
2
|
-
const ESCROW_DEPOSIT_ABI = [
|
|
3
|
-
{
|
|
4
|
-
type: "function",
|
|
5
|
-
name: "depositNative",
|
|
6
|
-
stateMutability: "payable",
|
|
7
|
-
inputs: [{ name: "account", type: "address" }],
|
|
8
|
-
outputs: []
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
type: "function",
|
|
12
|
-
name: "depositToken",
|
|
13
|
-
stateMutability: "nonpayable",
|
|
14
|
-
inputs: [
|
|
15
|
-
{ name: "account", type: "address" },
|
|
16
|
-
{ name: "token", type: "address" },
|
|
17
|
-
{ name: "amount", type: "uint256" }
|
|
18
|
-
],
|
|
19
|
-
outputs: []
|
|
20
|
-
}
|
|
21
|
-
];
|
|
22
|
-
function escrowContractAddress(config) {
|
|
23
|
-
return config.contracts.dataPortabilityEscrow;
|
|
24
|
-
}
|
|
25
|
-
function encodeDepositNativeData(input) {
|
|
26
|
-
return encodeFunctionData({
|
|
27
|
-
abi: ESCROW_DEPOSIT_ABI,
|
|
28
|
-
functionName: "depositNative",
|
|
29
|
-
args: [input.account]
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
function encodeDepositTokenData(input) {
|
|
33
|
-
return encodeFunctionData({
|
|
34
|
-
abi: ESCROW_DEPOSIT_ABI,
|
|
35
|
-
functionName: "depositToken",
|
|
36
|
-
args: [input.account, input.token, input.amount]
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
function buildDepositNativeRequest(config, input) {
|
|
40
|
-
return {
|
|
41
|
-
to: escrowContractAddress(config),
|
|
42
|
-
data: encodeDepositNativeData({ account: input.account }),
|
|
43
|
-
value: input.amount
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
function buildDepositTokenRequest(config, input) {
|
|
47
|
-
return {
|
|
48
|
-
to: escrowContractAddress(config),
|
|
49
|
-
data: encodeDepositTokenData(input)
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
export {
|
|
53
|
-
ESCROW_DEPOSIT_ABI,
|
|
54
|
-
buildDepositNativeRequest,
|
|
55
|
-
buildDepositTokenRequest,
|
|
56
|
-
encodeDepositNativeData,
|
|
57
|
-
encodeDepositTokenData,
|
|
58
|
-
escrowContractAddress
|
|
59
|
-
};
|
|
60
|
-
//# sourceMappingURL=escrow-deposit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/protocol/escrow-deposit.ts"],"sourcesContent":["/**\n * On-chain deposit primitives for the DataPortabilityEscrow contract.\n *\n * The escrow holds the finalized balance that `/v1/escrow/pay` debits against.\n * A payer credits their balance by sending one of two function calls to the\n * escrow contract — depositNative (native VANA, amount via `msg.value`) or\n * depositToken (ERC-20, caller must `approve` the escrow first). The credited\n * `account` need not equal `msg.sender`, so a third party can fund someone\n * else's escrow.\n *\n * Once the on-chain tx lands, call `GatewayClient.submitEscrowDeposit({txHash})`\n * to announce it; the gateway reconciles it into the balance and surfaces it\n * under `getEscrowBalance(account).deposits.finalized`.\n *\n * These helpers are signer/transport-agnostic — they return the raw\n * `{to, data, value?}` request object so callers can feed it to any wallet\n * stack (viem `sendTransaction`/`writeContract`, ethers, wallet-rpc, MPC,\n * Safe transactions, etc.).\n *\n * @category Protocol\n */\nimport { encodeFunctionData } from \"viem\";\nimport type { DataPortabilityGatewayConfig } from \"./eip712\";\n\n// ABI for the two deposit entry points on DataPortabilityEscrow. Same shape\n// the gateway uses to decode pending/mined tx calldata at\n// /v1/escrow/deposit time (data-gateway/lib/escrow.ts:39).\nexport const ESCROW_DEPOSIT_ABI = [\n {\n type: \"function\",\n name: \"depositNative\",\n stateMutability: \"payable\",\n inputs: [{ name: \"account\", type: \"address\" }],\n outputs: [],\n },\n {\n type: \"function\",\n name: \"depositToken\",\n stateMutability: \"nonpayable\",\n inputs: [\n { name: \"account\", type: \"address\" },\n { name: \"token\", type: \"address\" },\n { name: \"amount\", type: \"uint256\" },\n ],\n outputs: [],\n },\n] as const;\n\nexport function escrowContractAddress(\n config: DataPortabilityGatewayConfig,\n): `0x${string}` {\n return config.contracts.dataPortabilityEscrow as `0x${string}`;\n}\n\nexport interface DepositNativeInput {\n // Address credited inside the escrow. Often the same as the wallet sending\n // the tx, but third-party funding is supported.\n account: `0x${string}`;\n amount: bigint;\n}\n\nexport interface DepositTokenInput {\n account: `0x${string}`;\n // ERC-20 contract address.\n token: `0x${string}`;\n amount: bigint;\n}\n\n// Shape compatible with viem's `sendTransaction` / `writeContract` request\n// objects. `value` is omitted on the ERC-20 path because the amount lives in\n// the token contract, not `msg.value`.\nexport interface DepositTransactionRequest {\n to: `0x${string}`;\n data: `0x${string}`;\n value?: bigint;\n}\n\nexport function encodeDepositNativeData(input: {\n account: `0x${string}`;\n}): `0x${string}` {\n return encodeFunctionData({\n abi: ESCROW_DEPOSIT_ABI,\n functionName: \"depositNative\",\n args: [input.account],\n });\n}\n\nexport function encodeDepositTokenData(\n input: DepositTokenInput,\n): `0x${string}` {\n return encodeFunctionData({\n abi: ESCROW_DEPOSIT_ABI,\n functionName: \"depositToken\",\n args: [input.account, input.token, input.amount],\n });\n}\n\n// Build the full tx request for a native-VANA deposit. Feed it straight to\n// `walletClient.sendTransaction({...req, account, chain})`. ERC-20 needs a\n// prior `approve(escrow, amount)` on the token — use viem's built-in\n// `erc20Abi` for that; the SDK doesn't bundle one to avoid the import surface.\nexport function buildDepositNativeRequest(\n config: DataPortabilityGatewayConfig,\n input: DepositNativeInput,\n): DepositTransactionRequest {\n return {\n to: escrowContractAddress(config),\n data: encodeDepositNativeData({ account: input.account }),\n value: input.amount,\n };\n}\n\nexport function buildDepositTokenRequest(\n config: DataPortabilityGatewayConfig,\n input: DepositTokenInput,\n): DepositTransactionRequest {\n return {\n to: escrowContractAddress(config),\n data: encodeDepositTokenData(input),\n };\n}\n"],"mappings":"AAqBA,SAAS,0BAA0B;AAM5B,MAAM,qBAAqB;AAAA,EAChC;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,iBAAiB;AAAA,IACjB,QAAQ,CAAC,EAAE,MAAM,WAAW,MAAM,UAAU,CAAC;AAAA,IAC7C,SAAS,CAAC;AAAA,EACZ;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,iBAAiB;AAAA,IACjB,QAAQ;AAAA,MACN,EAAE,MAAM,WAAW,MAAM,UAAU;AAAA,MACnC,EAAE,MAAM,SAAS,MAAM,UAAU;AAAA,MACjC,EAAE,MAAM,UAAU,MAAM,UAAU;AAAA,IACpC;AAAA,IACA,SAAS,CAAC;AAAA,EACZ;AACF;AAEO,SAAS,sBACd,QACe;AACf,SAAO,OAAO,UAAU;AAC1B;AAyBO,SAAS,wBAAwB,OAEtB;AAChB,SAAO,mBAAmB;AAAA,IACxB,KAAK;AAAA,IACL,cAAc;AAAA,IACd,MAAM,CAAC,MAAM,OAAO;AAAA,EACtB,CAAC;AACH;AAEO,SAAS,uBACd,OACe;AACf,SAAO,mBAAmB;AAAA,IACxB,KAAK;AAAA,IACL,cAAc;AAAA,IACd,MAAM,CAAC,MAAM,SAAS,MAAM,OAAO,MAAM,MAAM;AAAA,EACjD,CAAC;AACH;AAMO,SAAS,0BACd,QACA,OAC2B;AAC3B,SAAO;AAAA,IACL,IAAI,sBAAsB,MAAM;AAAA,IAChC,MAAM,wBAAwB,EAAE,SAAS,MAAM,QAAQ,CAAC;AAAA,IACxD,OAAO,MAAM;AAAA,EACf;AACF;AAEO,SAAS,yBACd,QACA,OAC2B;AAC3B,SAAO;AAAA,IACL,IAAI,sBAAsB,MAAM;AAAA,IAChC,MAAM,uBAAuB,KAAK;AAAA,EACpC;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* End-to-end test of the deposit + payment flow.
|
|
3
|
-
*
|
|
4
|
-
* The SDK is signer- and transport-agnostic. To prove the helpers compose
|
|
5
|
-
* correctly we wire them through:
|
|
6
|
-
*
|
|
7
|
-
* - A real viem `WalletClient` against an in-memory L1 (a custom RPC
|
|
8
|
-
* transport routes JSON-RPC calls to a Map-backed chain). The wallet
|
|
9
|
-
* genuinely signs an EIP-1559 transaction with the depositNative
|
|
10
|
-
* calldata produced by buildDepositNativeRequest.
|
|
11
|
-
*
|
|
12
|
-
* - A fetch-mocked gateway that decodes that same calldata via
|
|
13
|
-
* ESCROW_DEPOSIT_ABI, credits a balance, and later recovers the
|
|
14
|
-
* GenericPayment EIP-712 signer with viem's recoverTypedDataAddress —
|
|
15
|
-
* same cryptographic checks the real gateway runs.
|
|
16
|
-
*
|
|
17
|
-
* Anything weaker than this (hand-rolled sendTx, hand-rolled sig recovery)
|
|
18
|
-
* would let the SDK's encoder or domain helpers drift silently. Going through
|
|
19
|
-
* viem's real wallet + sign paths is what makes this a useful e2e.
|
|
20
|
-
*/
|
|
21
|
-
export {};
|