@le-space/core 0.6.4 → 0.6.5
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/ccip-5OBQFK3F.js +14 -0
- package/{ccip-62HLVIJN.js → chunk-H2AJLDEV.js} +89 -87
- package/index.d.ts +7 -1
- package/index.js +107 -26
- package/package.json +3 -3
package/ccip-5OBQFK3F.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ccipRequest,
|
|
3
|
+
offchainLookup,
|
|
4
|
+
offchainLookupAbiItem,
|
|
5
|
+
offchainLookupSignature
|
|
6
|
+
} from "./chunk-H2AJLDEV.js";
|
|
7
|
+
import "./chunk-3CGLGAGR.js";
|
|
8
|
+
import "./chunk-4VNS5WPM.js";
|
|
9
|
+
export {
|
|
10
|
+
ccipRequest,
|
|
11
|
+
offchainLookup,
|
|
12
|
+
offchainLookupAbiItem,
|
|
13
|
+
offchainLookupSignature
|
|
14
|
+
};
|
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
toBytes,
|
|
16
16
|
u32
|
|
17
17
|
} from "./chunk-3CGLGAGR.js";
|
|
18
|
-
import "./chunk-4VNS5WPM.js";
|
|
19
18
|
|
|
20
19
|
// ../../node_modules/.pnpm/abitype@1.2.3_typescript@5.9.3/node_modules/abitype/dist/esm/version.js
|
|
21
20
|
var version = "1.2.3";
|
|
@@ -729,15 +728,15 @@ function parseAbi(signatures) {
|
|
|
729
728
|
return abi;
|
|
730
729
|
}
|
|
731
730
|
|
|
732
|
-
// ../../node_modules/.pnpm/ox@
|
|
731
|
+
// ../../node_modules/.pnpm/ox@0.14.29_typescript@5.9.3/node_modules/ox/_esm/core/version.js
|
|
733
732
|
var version2 = "0.1.1";
|
|
734
733
|
|
|
735
|
-
// ../../node_modules/.pnpm/ox@
|
|
734
|
+
// ../../node_modules/.pnpm/ox@0.14.29_typescript@5.9.3/node_modules/ox/_esm/core/internal/errors.js
|
|
736
735
|
function getVersion() {
|
|
737
736
|
return version2;
|
|
738
737
|
}
|
|
739
738
|
|
|
740
|
-
// ../../node_modules/.pnpm/ox@
|
|
739
|
+
// ../../node_modules/.pnpm/ox@0.14.29_typescript@5.9.3/node_modules/ox/_esm/core/Errors.js
|
|
741
740
|
var BaseError2 = class _BaseError extends Error {
|
|
742
741
|
static setStaticOptions(options) {
|
|
743
742
|
_BaseError.prototype.docsOrigin = options.docsOrigin;
|
|
@@ -866,7 +865,7 @@ function walk(err, fn) {
|
|
|
866
865
|
return fn ? null : err;
|
|
867
866
|
}
|
|
868
867
|
|
|
869
|
-
// ../../node_modules/.pnpm/ox@
|
|
868
|
+
// ../../node_modules/.pnpm/ox@0.14.29_typescript@5.9.3/node_modules/ox/_esm/core/internal/hex.js
|
|
870
869
|
function pad(hex_, options = {}) {
|
|
871
870
|
const { dir, size: size3 = 32 } = options;
|
|
872
871
|
if (size3 === 0)
|
|
@@ -881,7 +880,7 @@ function pad(hex_, options = {}) {
|
|
|
881
880
|
return `0x${hex[dir === "right" ? "padEnd" : "padStart"](size3 * 2, "0")}`;
|
|
882
881
|
}
|
|
883
882
|
|
|
884
|
-
// ../../node_modules/.pnpm/ox@
|
|
883
|
+
// ../../node_modules/.pnpm/ox@0.14.29_typescript@5.9.3/node_modules/ox/_esm/core/Hex.js
|
|
885
884
|
function fromNumber(value, options = {}) {
|
|
886
885
|
const { signed, size: size3 } = options;
|
|
887
886
|
const value_ = BigInt(value);
|
|
@@ -937,7 +936,7 @@ var SizeExceedsPaddingSizeError = class extends BaseError2 {
|
|
|
937
936
|
}
|
|
938
937
|
};
|
|
939
938
|
|
|
940
|
-
// ../../node_modules/.pnpm/ox@
|
|
939
|
+
// ../../node_modules/.pnpm/ox@0.14.29_typescript@5.9.3/node_modules/ox/_esm/core/Withdrawal.js
|
|
941
940
|
function toRpc(withdrawal) {
|
|
942
941
|
return {
|
|
943
942
|
address: withdrawal.address,
|
|
@@ -947,7 +946,7 @@ function toRpc(withdrawal) {
|
|
|
947
946
|
};
|
|
948
947
|
}
|
|
949
948
|
|
|
950
|
-
// ../../node_modules/.pnpm/ox@
|
|
949
|
+
// ../../node_modules/.pnpm/ox@0.14.29_typescript@5.9.3/node_modules/ox/_esm/core/BlockOverrides.js
|
|
951
950
|
function toRpc2(blockOverrides) {
|
|
952
951
|
return {
|
|
953
952
|
...typeof blockOverrides.baseFeePerGas === "bigint" && {
|
|
@@ -977,14 +976,14 @@ function toRpc2(blockOverrides) {
|
|
|
977
976
|
};
|
|
978
977
|
}
|
|
979
978
|
|
|
980
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
979
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/accounts/utils/parseAccount.js
|
|
981
980
|
function parseAccount(account) {
|
|
982
981
|
if (typeof account === "string")
|
|
983
982
|
return { address: account, type: "json-rpc" };
|
|
984
983
|
return account;
|
|
985
984
|
}
|
|
986
985
|
|
|
987
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
986
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/constants/abis.js
|
|
988
987
|
var multicall3Abi = [
|
|
989
988
|
{
|
|
990
989
|
inputs: [
|
|
@@ -1250,18 +1249,18 @@ var universalResolverReverseAbi = [
|
|
|
1250
1249
|
}
|
|
1251
1250
|
];
|
|
1252
1251
|
|
|
1253
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1252
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/constants/contract.js
|
|
1254
1253
|
var aggregate3Signature = "0x82ad56cb";
|
|
1255
1254
|
|
|
1256
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1255
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/constants/contracts.js
|
|
1257
1256
|
var deploylessCallViaBytecodeBytecode = "0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe";
|
|
1258
1257
|
var deploylessCallViaFactoryBytecode = "0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";
|
|
1259
1258
|
var multicall3Bytecode = "0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";
|
|
1260
1259
|
|
|
1261
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1262
|
-
var version3 = "2.
|
|
1260
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/errors/version.js
|
|
1261
|
+
var version3 = "2.53.1";
|
|
1263
1262
|
|
|
1264
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1263
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/errors/base.js
|
|
1265
1264
|
var errorConfig = {
|
|
1266
1265
|
getDocsUrl: ({ docsBaseUrl, docsPath: docsPath6 = "", docsSlug }) => docsPath6 ? `${docsBaseUrl ?? "https://viem.sh"}${docsPath6}${docsSlug ? `#${docsSlug}` : ""}` : void 0,
|
|
1267
1266
|
version: `viem@${version3}`
|
|
@@ -1345,7 +1344,7 @@ function walk2(err, fn) {
|
|
|
1345
1344
|
return fn ? null : err;
|
|
1346
1345
|
}
|
|
1347
1346
|
|
|
1348
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1347
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/errors/chain.js
|
|
1349
1348
|
var ChainDoesNotSupportContract = class extends BaseError3 {
|
|
1350
1349
|
constructor({ blockNumber, chain, contract }) {
|
|
1351
1350
|
super(`Chain "${chain.name}" does not support contract "${contract.name}".`, {
|
|
@@ -1369,7 +1368,7 @@ var ClientChainNotConfiguredError = class extends BaseError3 {
|
|
|
1369
1368
|
}
|
|
1370
1369
|
};
|
|
1371
1370
|
|
|
1372
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1371
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/constants/solidity.js
|
|
1373
1372
|
var solidityError = {
|
|
1374
1373
|
inputs: [
|
|
1375
1374
|
{
|
|
@@ -1391,7 +1390,7 @@ var solidityPanic = {
|
|
|
1391
1390
|
type: "error"
|
|
1392
1391
|
};
|
|
1393
1392
|
|
|
1394
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1393
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/abi/formatAbiItem.js
|
|
1395
1394
|
function formatAbiItem2(abiItem, { includeName = false } = {}) {
|
|
1396
1395
|
if (abiItem.type !== "function" && abiItem.type !== "event" && abiItem.type !== "error")
|
|
1397
1396
|
throw new InvalidDefinitionTypeError(abiItem.type);
|
|
@@ -1409,7 +1408,7 @@ function formatAbiParam(param, { includeName }) {
|
|
|
1409
1408
|
return param.type + (includeName && param.name ? ` ${param.name}` : "");
|
|
1410
1409
|
}
|
|
1411
1410
|
|
|
1412
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1411
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/data/isHex.js
|
|
1413
1412
|
function isHex(value, { strict = true } = {}) {
|
|
1414
1413
|
if (!value)
|
|
1415
1414
|
return false;
|
|
@@ -1418,14 +1417,14 @@ function isHex(value, { strict = true } = {}) {
|
|
|
1418
1417
|
return strict ? /^0x[0-9a-fA-F]*$/.test(value) : value.startsWith("0x");
|
|
1419
1418
|
}
|
|
1420
1419
|
|
|
1421
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1420
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/data/size.js
|
|
1422
1421
|
function size2(value) {
|
|
1423
1422
|
if (isHex(value, { strict: false }))
|
|
1424
1423
|
return Math.ceil((value.length - 2) / 2);
|
|
1425
1424
|
return value.length;
|
|
1426
1425
|
}
|
|
1427
1426
|
|
|
1428
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1427
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/errors/abi.js
|
|
1429
1428
|
var AbiConstructorNotFoundError = class extends BaseError3 {
|
|
1430
1429
|
constructor({ docsPath: docsPath6 }) {
|
|
1431
1430
|
super([
|
|
@@ -1635,7 +1634,7 @@ var InvalidDefinitionTypeError = class extends BaseError3 {
|
|
|
1635
1634
|
}
|
|
1636
1635
|
};
|
|
1637
1636
|
|
|
1638
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1637
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/errors/data.js
|
|
1639
1638
|
var SliceOffsetOutOfBoundsError2 = class extends BaseError3 {
|
|
1640
1639
|
constructor({ offset, position, size: size3 }) {
|
|
1641
1640
|
super(`Slice ${position === "start" ? "starting" : "ending"} at offset "${offset}" is out-of-bounds (size: ${size3}).`, { name: "SliceOffsetOutOfBoundsError" });
|
|
@@ -1652,7 +1651,7 @@ var InvalidBytesLengthError = class extends BaseError3 {
|
|
|
1652
1651
|
}
|
|
1653
1652
|
};
|
|
1654
1653
|
|
|
1655
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1654
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/data/slice.js
|
|
1656
1655
|
function slice(value, start, end, { strict } = {}) {
|
|
1657
1656
|
if (isHex(value, { strict: false }))
|
|
1658
1657
|
return sliceHex(value, start, end, {
|
|
@@ -1694,7 +1693,7 @@ function sliceHex(value_, start, end, { strict } = {}) {
|
|
|
1694
1693
|
return value;
|
|
1695
1694
|
}
|
|
1696
1695
|
|
|
1697
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1696
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/data/pad.js
|
|
1698
1697
|
function pad2(hexOrBytes, { dir, size: size3 = 32 } = {}) {
|
|
1699
1698
|
if (typeof hexOrBytes === "string")
|
|
1700
1699
|
return padHex(hexOrBytes, { dir, size: size3 });
|
|
@@ -1729,7 +1728,7 @@ function padBytes(bytes, { dir, size: size3 = 32 } = {}) {
|
|
|
1729
1728
|
return paddedBytes;
|
|
1730
1729
|
}
|
|
1731
1730
|
|
|
1732
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1731
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/errors/encoding.js
|
|
1733
1732
|
var IntegerOutOfRangeError2 = class extends BaseError3 {
|
|
1734
1733
|
constructor({ max, min, signed, size: size3, value }) {
|
|
1735
1734
|
super(`Number "${value}" is not in safe ${size3 ? `${size3 * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`, { name: "IntegerOutOfRangeError" });
|
|
@@ -1748,7 +1747,7 @@ var SizeOverflowError2 = class extends BaseError3 {
|
|
|
1748
1747
|
}
|
|
1749
1748
|
};
|
|
1750
1749
|
|
|
1751
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1750
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/data/trim.js
|
|
1752
1751
|
function trim2(hexOrBytes, { dir = "left" } = {}) {
|
|
1753
1752
|
let data = typeof hexOrBytes === "string" ? hexOrBytes.replace("0x", "") : hexOrBytes;
|
|
1754
1753
|
let sliceLength = 0;
|
|
@@ -1767,7 +1766,7 @@ function trim2(hexOrBytes, { dir = "left" } = {}) {
|
|
|
1767
1766
|
return data;
|
|
1768
1767
|
}
|
|
1769
1768
|
|
|
1770
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1769
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/encoding/fromHex.js
|
|
1771
1770
|
function assertSize2(hexOrBytes, { size: size3 }) {
|
|
1772
1771
|
if (size2(hexOrBytes) > size3)
|
|
1773
1772
|
throw new SizeOverflowError2({
|
|
@@ -1802,7 +1801,7 @@ function hexToNumber(hex, opts = {}) {
|
|
|
1802
1801
|
return number;
|
|
1803
1802
|
}
|
|
1804
1803
|
|
|
1805
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1804
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/encoding/toHex.js
|
|
1806
1805
|
var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
|
|
1807
1806
|
function toHex(value, opts = {}) {
|
|
1808
1807
|
if (typeof value === "number" || typeof value === "bigint")
|
|
@@ -1868,7 +1867,7 @@ function stringToHex(value_, opts = {}) {
|
|
|
1868
1867
|
return bytesToHex(value, opts);
|
|
1869
1868
|
}
|
|
1870
1869
|
|
|
1871
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1870
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/encoding/toBytes.js
|
|
1872
1871
|
var encoder2 = /* @__PURE__ */ new TextEncoder();
|
|
1873
1872
|
function toBytes2(value, opts = {}) {
|
|
1874
1873
|
if (typeof value === "number" || typeof value === "bigint")
|
|
@@ -2120,7 +2119,7 @@ var Keccak = class _Keccak extends Hash {
|
|
|
2120
2119
|
var gen = (suffix, blockLen, outputLen) => createHasher(() => new Keccak(blockLen, suffix, outputLen));
|
|
2121
2120
|
var keccak_256 = /* @__PURE__ */ (() => gen(1, 136, 256 / 8))();
|
|
2122
2121
|
|
|
2123
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2122
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/hash/keccak256.js
|
|
2124
2123
|
function keccak256(value, to_) {
|
|
2125
2124
|
const to = to_ || "hex";
|
|
2126
2125
|
const bytes = keccak_256(isHex(value, { strict: false }) ? toBytes2(value) : value);
|
|
@@ -2129,13 +2128,13 @@ function keccak256(value, to_) {
|
|
|
2129
2128
|
return toHex(bytes);
|
|
2130
2129
|
}
|
|
2131
2130
|
|
|
2132
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2131
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/hash/hashSignature.js
|
|
2133
2132
|
var hash = (value) => keccak256(toBytes2(value));
|
|
2134
2133
|
function hashSignature(sig) {
|
|
2135
2134
|
return hash(sig);
|
|
2136
2135
|
}
|
|
2137
2136
|
|
|
2138
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2137
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/hash/normalizeSignature.js
|
|
2139
2138
|
function normalizeSignature(signature) {
|
|
2140
2139
|
let active = true;
|
|
2141
2140
|
let current = "";
|
|
@@ -2179,7 +2178,7 @@ function normalizeSignature(signature) {
|
|
|
2179
2178
|
return result;
|
|
2180
2179
|
}
|
|
2181
2180
|
|
|
2182
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2181
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/hash/toSignature.js
|
|
2183
2182
|
var toSignature = (def) => {
|
|
2184
2183
|
const def_ = (() => {
|
|
2185
2184
|
if (typeof def === "string")
|
|
@@ -2189,15 +2188,15 @@ var toSignature = (def) => {
|
|
|
2189
2188
|
return normalizeSignature(def_);
|
|
2190
2189
|
};
|
|
2191
2190
|
|
|
2192
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2191
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/hash/toSignatureHash.js
|
|
2193
2192
|
function toSignatureHash(fn) {
|
|
2194
2193
|
return hashSignature(toSignature(fn));
|
|
2195
2194
|
}
|
|
2196
2195
|
|
|
2197
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2196
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/hash/toFunctionSelector.js
|
|
2198
2197
|
var toFunctionSelector = (fn) => slice(toSignatureHash(fn), 0, 4);
|
|
2199
2198
|
|
|
2200
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2199
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/errors/address.js
|
|
2201
2200
|
var InvalidAddressError = class extends BaseError3 {
|
|
2202
2201
|
constructor({ address }) {
|
|
2203
2202
|
super(`Address "${address}" is invalid.`, {
|
|
@@ -2210,7 +2209,7 @@ var InvalidAddressError = class extends BaseError3 {
|
|
|
2210
2209
|
}
|
|
2211
2210
|
};
|
|
2212
2211
|
|
|
2213
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2212
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/lru.js
|
|
2214
2213
|
var LruMap = class extends Map {
|
|
2215
2214
|
constructor(size3) {
|
|
2216
2215
|
super();
|
|
@@ -2243,7 +2242,7 @@ var LruMap = class extends Map {
|
|
|
2243
2242
|
}
|
|
2244
2243
|
};
|
|
2245
2244
|
|
|
2246
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2245
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/address/isAddress.js
|
|
2247
2246
|
var addressRegex = /^0x[a-fA-F0-9]{40}$/;
|
|
2248
2247
|
var isAddressCache = /* @__PURE__ */ new LruMap(8192);
|
|
2249
2248
|
function isAddress(address, options) {
|
|
@@ -2264,7 +2263,7 @@ function isAddress(address, options) {
|
|
|
2264
2263
|
return result;
|
|
2265
2264
|
}
|
|
2266
2265
|
|
|
2267
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2266
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/address/getAddress.js
|
|
2268
2267
|
var checksumAddressCache = /* @__PURE__ */ new LruMap(8192);
|
|
2269
2268
|
function checksumAddress(address_, chainId) {
|
|
2270
2269
|
if (checksumAddressCache.has(`${address_}.${chainId}`))
|
|
@@ -2285,7 +2284,7 @@ function checksumAddress(address_, chainId) {
|
|
|
2285
2284
|
return result;
|
|
2286
2285
|
}
|
|
2287
2286
|
|
|
2288
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2287
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/errors/cursor.js
|
|
2289
2288
|
var NegativeOffsetError = class extends BaseError3 {
|
|
2290
2289
|
constructor({ offset }) {
|
|
2291
2290
|
super(`Offset \`${offset}\` cannot be negative.`, {
|
|
@@ -2304,7 +2303,7 @@ var RecursiveReadLimitExceededError = class extends BaseError3 {
|
|
|
2304
2303
|
}
|
|
2305
2304
|
};
|
|
2306
2305
|
|
|
2307
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2306
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/cursor.js
|
|
2308
2307
|
var staticCursor = {
|
|
2309
2308
|
bytes: new Uint8Array(),
|
|
2310
2309
|
dataView: new DataView(new ArrayBuffer(0)),
|
|
@@ -2473,7 +2472,7 @@ function createCursor(bytes, { recursiveReadLimit = 8192 } = {}) {
|
|
|
2473
2472
|
return cursor;
|
|
2474
2473
|
}
|
|
2475
2474
|
|
|
2476
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2475
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/encoding/fromBytes.js
|
|
2477
2476
|
function bytesToBigInt(bytes, opts = {}) {
|
|
2478
2477
|
if (typeof opts.size !== "undefined")
|
|
2479
2478
|
assertSize2(bytes, { size: opts.size });
|
|
@@ -2505,7 +2504,7 @@ function bytesToString(bytes_, opts = {}) {
|
|
|
2505
2504
|
return new TextDecoder().decode(bytes);
|
|
2506
2505
|
}
|
|
2507
2506
|
|
|
2508
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2507
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/data/concat.js
|
|
2509
2508
|
function concat(values) {
|
|
2510
2509
|
if (typeof values[0] === "string")
|
|
2511
2510
|
return concatHex(values);
|
|
@@ -2528,10 +2527,10 @@ function concatHex(values) {
|
|
|
2528
2527
|
return `0x${values.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
|
|
2529
2528
|
}
|
|
2530
2529
|
|
|
2531
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2530
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/regex.js
|
|
2532
2531
|
var integerRegex2 = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;
|
|
2533
2532
|
|
|
2534
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2533
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/abi/encodeAbiParameters.js
|
|
2535
2534
|
function encodeAbiParameters(params, values) {
|
|
2536
2535
|
if (params.length !== values.length)
|
|
2537
2536
|
throw new AbiEncodingLengthMismatchError({
|
|
@@ -2745,7 +2744,7 @@ function getArrayComponents(type) {
|
|
|
2745
2744
|
) : void 0;
|
|
2746
2745
|
}
|
|
2747
2746
|
|
|
2748
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2747
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/abi/decodeAbiParameters.js
|
|
2749
2748
|
function decodeAbiParameters(params, data) {
|
|
2750
2749
|
const bytes = typeof data === "string" ? hexToBytes(data) : data;
|
|
2751
2750
|
const cursor = createCursor(bytes);
|
|
@@ -2932,7 +2931,7 @@ function hasDynamicChild(param) {
|
|
|
2932
2931
|
return false;
|
|
2933
2932
|
}
|
|
2934
2933
|
|
|
2935
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2934
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/abi/decodeErrorResult.js
|
|
2936
2935
|
function decodeErrorResult(parameters) {
|
|
2937
2936
|
const { abi, data, cause } = parameters;
|
|
2938
2937
|
const signature = slice(data, 0, 4);
|
|
@@ -2952,16 +2951,16 @@ function decodeErrorResult(parameters) {
|
|
|
2952
2951
|
};
|
|
2953
2952
|
}
|
|
2954
2953
|
|
|
2955
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2954
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/stringify.js
|
|
2956
2955
|
var stringify = (value, replacer, space) => JSON.stringify(value, (key, value_) => {
|
|
2957
2956
|
const value2 = typeof value_ === "bigint" ? value_.toString() : value_;
|
|
2958
2957
|
return typeof replacer === "function" ? replacer(key, value2) : value2;
|
|
2959
2958
|
}, space);
|
|
2960
2959
|
|
|
2961
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2960
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/hash/toEventSelector.js
|
|
2962
2961
|
var toEventSelector = toSignatureHash;
|
|
2963
2962
|
|
|
2964
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2963
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/abi/getAbiItem.js
|
|
2965
2964
|
function getAbiItem(parameters) {
|
|
2966
2965
|
const { abi, args = [], name } = parameters;
|
|
2967
2966
|
const isSelector = isHex(name, { strict: false });
|
|
@@ -3073,7 +3072,7 @@ function getAmbiguousTypes(sourceParameters, targetParameters, args) {
|
|
|
3073
3072
|
return;
|
|
3074
3073
|
}
|
|
3075
3074
|
|
|
3076
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3075
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/constants/unit.js
|
|
3077
3076
|
var etherUnits = {
|
|
3078
3077
|
gwei: 9,
|
|
3079
3078
|
wei: 18
|
|
@@ -3083,7 +3082,7 @@ var gweiUnits = {
|
|
|
3083
3082
|
wei: 9
|
|
3084
3083
|
};
|
|
3085
3084
|
|
|
3086
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3085
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/unit/formatUnits.js
|
|
3087
3086
|
function formatUnits(value, decimals) {
|
|
3088
3087
|
let display = value.toString();
|
|
3089
3088
|
const negative = display.startsWith("-");
|
|
@@ -3098,17 +3097,17 @@ function formatUnits(value, decimals) {
|
|
|
3098
3097
|
return `${negative ? "-" : ""}${integer || "0"}${fraction ? `.${fraction}` : ""}`;
|
|
3099
3098
|
}
|
|
3100
3099
|
|
|
3101
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3100
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/unit/formatEther.js
|
|
3102
3101
|
function formatEther(wei, unit = "wei") {
|
|
3103
3102
|
return formatUnits(wei, etherUnits[unit]);
|
|
3104
3103
|
}
|
|
3105
3104
|
|
|
3106
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3105
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/unit/formatGwei.js
|
|
3107
3106
|
function formatGwei(wei, unit = "wei") {
|
|
3108
3107
|
return formatUnits(wei, gweiUnits[unit]);
|
|
3109
3108
|
}
|
|
3110
3109
|
|
|
3111
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3110
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/errors/stateOverride.js
|
|
3112
3111
|
var AccountStateConflictError = class extends BaseError3 {
|
|
3113
3112
|
constructor({ address }) {
|
|
3114
3113
|
super(`State for account "${address}" is set multiple times.`, {
|
|
@@ -3154,7 +3153,7 @@ function prettyStateOverride(stateOverride) {
|
|
|
3154
3153
|
}, " State Override:\n").slice(0, -1);
|
|
3155
3154
|
}
|
|
3156
3155
|
|
|
3157
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3156
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/errors/transaction.js
|
|
3158
3157
|
function prettyPrint(args) {
|
|
3159
3158
|
const entries = Object.entries(args).map(([key, value]) => {
|
|
3160
3159
|
if (value === void 0 || value === false)
|
|
@@ -3165,7 +3164,7 @@ function prettyPrint(args) {
|
|
|
3165
3164
|
return entries.map(([key, value]) => ` ${`${key}:`.padEnd(maxLength + 1)} ${value}`).join("\n");
|
|
3166
3165
|
}
|
|
3167
3166
|
|
|
3168
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3167
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/errors/utils.js
|
|
3169
3168
|
function getAbortError(signal) {
|
|
3170
3169
|
if (signal?.reason)
|
|
3171
3170
|
return signal.reason;
|
|
@@ -3191,7 +3190,7 @@ var getUrl = (url) => {
|
|
|
3191
3190
|
}
|
|
3192
3191
|
};
|
|
3193
3192
|
|
|
3194
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3193
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/errors/contract.js
|
|
3195
3194
|
var CallExecutionError = class extends BaseError3 {
|
|
3196
3195
|
constructor(cause, { account: account_, docsPath: docsPath6, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, stateOverride }) {
|
|
3197
3196
|
const account = account_ ? parseAccount(account_) : void 0;
|
|
@@ -3260,7 +3259,7 @@ var RawContractError = class extends BaseError3 {
|
|
|
3260
3259
|
}
|
|
3261
3260
|
};
|
|
3262
3261
|
|
|
3263
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3262
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/abi/decodeFunctionResult.js
|
|
3264
3263
|
var docsPath = "/docs/contract/decodeFunctionResult";
|
|
3265
3264
|
function decodeFunctionResult(parameters) {
|
|
3266
3265
|
const { abi, args, functionName, data } = parameters;
|
|
@@ -3283,7 +3282,7 @@ function decodeFunctionResult(parameters) {
|
|
|
3283
3282
|
return void 0;
|
|
3284
3283
|
}
|
|
3285
3284
|
|
|
3286
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3285
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/abi/encodeDeployData.js
|
|
3287
3286
|
var docsPath2 = "/docs/contract/encodeDeployData";
|
|
3288
3287
|
function encodeDeployData(parameters) {
|
|
3289
3288
|
const { abi, args, bytecode } = parameters;
|
|
@@ -3300,7 +3299,7 @@ function encodeDeployData(parameters) {
|
|
|
3300
3299
|
return concatHex([bytecode, data]);
|
|
3301
3300
|
}
|
|
3302
3301
|
|
|
3303
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3302
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/abi/prepareEncodeFunctionData.js
|
|
3304
3303
|
var docsPath3 = "/docs/contract/encodeFunctionData";
|
|
3305
3304
|
function prepareEncodeFunctionData(parameters) {
|
|
3306
3305
|
const { abi, args, functionName } = parameters;
|
|
@@ -3323,7 +3322,7 @@ function prepareEncodeFunctionData(parameters) {
|
|
|
3323
3322
|
};
|
|
3324
3323
|
}
|
|
3325
3324
|
|
|
3326
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3325
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/abi/encodeFunctionData.js
|
|
3327
3326
|
function encodeFunctionData(parameters) {
|
|
3328
3327
|
const { args } = parameters;
|
|
3329
3328
|
const { abi, functionName } = (() => {
|
|
@@ -3337,7 +3336,7 @@ function encodeFunctionData(parameters) {
|
|
|
3337
3336
|
return concatHex([signature, data ?? "0x"]);
|
|
3338
3337
|
}
|
|
3339
3338
|
|
|
3340
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3339
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/address/isAddressEqual.js
|
|
3341
3340
|
function isAddressEqual(a, b) {
|
|
3342
3341
|
if (!isAddress(a, { strict: false }))
|
|
3343
3342
|
throw new InvalidAddressError({ address: a });
|
|
@@ -3346,7 +3345,7 @@ function isAddressEqual(a, b) {
|
|
|
3346
3345
|
return a.toLowerCase() === b.toLowerCase();
|
|
3347
3346
|
}
|
|
3348
3347
|
|
|
3349
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3348
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/block/formatBlockParameter.js
|
|
3350
3349
|
function formatBlockParameter(parameters) {
|
|
3351
3350
|
const { blockHash, blockNumber, blockTag, requireCanonical } = parameters;
|
|
3352
3351
|
if (requireCanonical !== void 0 && !blockHash)
|
|
@@ -3358,7 +3357,7 @@ function formatBlockParameter(parameters) {
|
|
|
3358
3357
|
return blockTag ?? "latest";
|
|
3359
3358
|
}
|
|
3360
3359
|
|
|
3361
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3360
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/chain/getChainContractAddress.js
|
|
3362
3361
|
function getChainContractAddress({ blockNumber, chain, contract: name }) {
|
|
3363
3362
|
const contract = chain?.contracts?.[name];
|
|
3364
3363
|
if (!contract)
|
|
@@ -3378,7 +3377,7 @@ function getChainContractAddress({ blockNumber, chain, contract: name }) {
|
|
|
3378
3377
|
return contract.address;
|
|
3379
3378
|
}
|
|
3380
3379
|
|
|
3381
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3380
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/errors/node.js
|
|
3382
3381
|
var ExecutionRevertedError = class extends BaseError3 {
|
|
3383
3382
|
constructor({ cause, message } = {}) {
|
|
3384
3383
|
const reason = message?.replace("execution reverted: ", "")?.replace("execution reverted", "");
|
|
@@ -3557,7 +3556,7 @@ var UnknownNodeError = class extends BaseError3 {
|
|
|
3557
3556
|
}
|
|
3558
3557
|
};
|
|
3559
3558
|
|
|
3560
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3559
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/errors/request.js
|
|
3561
3560
|
var HttpRequestError = class extends BaseError3 {
|
|
3562
3561
|
constructor({ body, cause, details, headers, status, url }) {
|
|
3563
3562
|
super("HTTP request failed.", {
|
|
@@ -3601,7 +3600,7 @@ var HttpRequestError = class extends BaseError3 {
|
|
|
3601
3600
|
}
|
|
3602
3601
|
};
|
|
3603
3602
|
|
|
3604
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3603
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/errors/getNodeError.js
|
|
3605
3604
|
function getNodeError(err, args) {
|
|
3606
3605
|
const message = (err.details || "").toLowerCase();
|
|
3607
3606
|
const executionRevertedError = err instanceof BaseError3 ? err.walk((e) => e?.code === ExecutionRevertedError.code) : err;
|
|
@@ -3650,7 +3649,7 @@ function getNodeError(err, args) {
|
|
|
3650
3649
|
});
|
|
3651
3650
|
}
|
|
3652
3651
|
|
|
3653
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3652
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/errors/getCallError.js
|
|
3654
3653
|
function getCallError(err, { docsPath: docsPath6, ...args }) {
|
|
3655
3654
|
const cause = (() => {
|
|
3656
3655
|
const cause2 = getNodeError(err, args);
|
|
@@ -3664,7 +3663,7 @@ function getCallError(err, { docsPath: docsPath6, ...args }) {
|
|
|
3664
3663
|
});
|
|
3665
3664
|
}
|
|
3666
3665
|
|
|
3667
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3666
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/formatters/extract.js
|
|
3668
3667
|
function extract(value_, { format }) {
|
|
3669
3668
|
if (!format)
|
|
3670
3669
|
return {};
|
|
@@ -3683,7 +3682,7 @@ function extract(value_, { format }) {
|
|
|
3683
3682
|
return value;
|
|
3684
3683
|
}
|
|
3685
3684
|
|
|
3686
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3685
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/formatters/transactionRequest.js
|
|
3687
3686
|
var rpcTransactionType = {
|
|
3688
3687
|
legacy: "0x0",
|
|
3689
3688
|
eip2930: "0x1",
|
|
@@ -3743,7 +3742,7 @@ function formatAuthorizationList(authorizationList) {
|
|
|
3743
3742
|
}));
|
|
3744
3743
|
}
|
|
3745
3744
|
|
|
3746
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3745
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/promise/withResolvers.js
|
|
3747
3746
|
function withResolvers() {
|
|
3748
3747
|
let resolve = () => void 0;
|
|
3749
3748
|
let reject = () => void 0;
|
|
@@ -3754,7 +3753,7 @@ function withResolvers() {
|
|
|
3754
3753
|
return { promise, resolve, reject };
|
|
3755
3754
|
}
|
|
3756
3755
|
|
|
3757
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3756
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/promise/createBatchScheduler.js
|
|
3758
3757
|
var schedulerCache = /* @__PURE__ */ new Map();
|
|
3759
3758
|
function createBatchScheduler({ fn, id, shouldSplitBatch, wait = 0, sort }) {
|
|
3760
3759
|
const exec = async () => {
|
|
@@ -3800,7 +3799,7 @@ function createBatchScheduler({ fn, id, shouldSplitBatch, wait = 0, sort }) {
|
|
|
3800
3799
|
};
|
|
3801
3800
|
}
|
|
3802
3801
|
|
|
3803
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3802
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/stateOverride.js
|
|
3804
3803
|
function serializeStateMapping(stateMapping) {
|
|
3805
3804
|
if (!stateMapping || stateMapping.length === 0)
|
|
3806
3805
|
return void 0;
|
|
@@ -3853,7 +3852,7 @@ function serializeStateOverride(parameters) {
|
|
|
3853
3852
|
return rpcStateOverride;
|
|
3854
3853
|
}
|
|
3855
3854
|
|
|
3856
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3855
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/constants/number.js
|
|
3857
3856
|
var maxInt8 = 2n ** (8n - 1n) - 1n;
|
|
3858
3857
|
var maxInt16 = 2n ** (16n - 1n) - 1n;
|
|
3859
3858
|
var maxInt24 = 2n ** (24n - 1n) - 1n;
|
|
@@ -3951,7 +3950,7 @@ var maxUint240 = 2n ** 240n - 1n;
|
|
|
3951
3950
|
var maxUint248 = 2n ** 248n - 1n;
|
|
3952
3951
|
var maxUint256 = 2n ** 256n - 1n;
|
|
3953
3952
|
|
|
3954
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3953
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/transaction/assertRequest.js
|
|
3955
3954
|
function assertRequest(args) {
|
|
3956
3955
|
const { account: account_, maxFeePerGas, maxPriorityFeePerGas, to } = args;
|
|
3957
3956
|
const account = account_ ? parseAccount(account_) : void 0;
|
|
@@ -3965,7 +3964,7 @@ function assertRequest(args) {
|
|
|
3965
3964
|
throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });
|
|
3966
3965
|
}
|
|
3967
3966
|
|
|
3968
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3967
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/actions/public/call.js
|
|
3969
3968
|
async function call(client, args) {
|
|
3970
3969
|
const { account: account_ = client.account, authorizationList, batch = Boolean(client.batch?.multicall), blockHash, blockNumber, blockTag = client.experimental_blockTag ?? "latest", requireCanonical, accessList, blobs, blockOverrides, code, data: data_, factory, factoryData, gas, gasPrice, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, nonce, requestOptions, to, value, stateOverride, ...rest } = args;
|
|
3971
3970
|
const account = account_ ? parseAccount(account_) : void 0;
|
|
@@ -4069,7 +4068,7 @@ async function call(client, args) {
|
|
|
4069
4068
|
if (isAbortError(err))
|
|
4070
4069
|
throw err;
|
|
4071
4070
|
const data2 = getRevertErrorData(err);
|
|
4072
|
-
const { offchainLookup: offchainLookup2, offchainLookupSignature: offchainLookupSignature2 } = await import("./ccip-
|
|
4071
|
+
const { offchainLookup: offchainLookup2, offchainLookupSignature: offchainLookupSignature2 } = await import("./ccip-5OBQFK3F.js");
|
|
4073
4072
|
if (client.ccipRead !== false && data2?.slice(0, 10) === offchainLookupSignature2 && to)
|
|
4074
4073
|
return {
|
|
4075
4074
|
data: await offchainLookup2(client, { data: data2, requestOptions, to })
|
|
@@ -4207,7 +4206,7 @@ function getRevertErrorData(err) {
|
|
|
4207
4206
|
return typeof error?.data === "object" ? error.data?.data : error.data;
|
|
4208
4207
|
}
|
|
4209
4208
|
|
|
4210
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
4209
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/errors/ccip.js
|
|
4211
4210
|
var OffchainLookupError = class extends BaseError3 {
|
|
4212
4211
|
constructor({ callbackSelector, cause, data, extraData, sender, urls }) {
|
|
4213
4212
|
super(cause.shortMessage || "An error occurred while fetching for an offchain result.", {
|
|
@@ -4252,7 +4251,7 @@ var OffchainLookupSenderMismatchError = class extends BaseError3 {
|
|
|
4252
4251
|
}
|
|
4253
4252
|
};
|
|
4254
4253
|
|
|
4255
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
4254
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/abi/decodeFunctionData.js
|
|
4256
4255
|
function decodeFunctionData(parameters) {
|
|
4257
4256
|
const { abi, data } = parameters;
|
|
4258
4257
|
const signature = slice(data, 0, 4);
|
|
@@ -4267,7 +4266,7 @@ function decodeFunctionData(parameters) {
|
|
|
4267
4266
|
};
|
|
4268
4267
|
}
|
|
4269
4268
|
|
|
4270
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
4269
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/abi/encodeErrorResult.js
|
|
4271
4270
|
var docsPath4 = "/docs/contract/encodeErrorResult";
|
|
4272
4271
|
function encodeErrorResult(parameters) {
|
|
4273
4272
|
const { abi, errorName, args } = parameters;
|
|
@@ -4291,7 +4290,7 @@ function encodeErrorResult(parameters) {
|
|
|
4291
4290
|
return concatHex([signature, data]);
|
|
4292
4291
|
}
|
|
4293
4292
|
|
|
4294
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
4293
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/abi/encodeFunctionResult.js
|
|
4295
4294
|
var docsPath5 = "/docs/contract/encodeFunctionResult";
|
|
4296
4295
|
function encodeFunctionResult(parameters) {
|
|
4297
4296
|
const { abi, functionName, result } = parameters;
|
|
@@ -4318,7 +4317,7 @@ function encodeFunctionResult(parameters) {
|
|
|
4318
4317
|
return encodeAbiParameters(abiItem.outputs, values);
|
|
4319
4318
|
}
|
|
4320
4319
|
|
|
4321
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
4320
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/ens/localBatchGatewayRequest.js
|
|
4322
4321
|
var localBatchGatewayUrl = "x-batch-gateway:true";
|
|
4323
4322
|
async function localBatchGatewayRequest(parameters) {
|
|
4324
4323
|
const { data, ccipRequest: ccipRequest2 } = parameters;
|
|
@@ -4354,7 +4353,7 @@ function encodeError(error) {
|
|
|
4354
4353
|
});
|
|
4355
4354
|
}
|
|
4356
4355
|
|
|
4357
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
4356
|
+
// ../../node_modules/.pnpm/viem@2.53.1_typescript@5.9.3/node_modules/viem/_esm/utils/ccip.js
|
|
4358
4357
|
var offchainLookupSignature = "0x556f1830";
|
|
4359
4358
|
var offchainLookupAbiItem = {
|
|
4360
4359
|
name: "OffchainLookup",
|
|
@@ -4477,9 +4476,12 @@ async function ccipRequest({ data, requestOptions, sender, urls }) {
|
|
|
4477
4476
|
}
|
|
4478
4477
|
throw error;
|
|
4479
4478
|
}
|
|
4479
|
+
|
|
4480
4480
|
export {
|
|
4481
|
-
|
|
4482
|
-
|
|
4481
|
+
stringToHex,
|
|
4482
|
+
keccak256,
|
|
4483
|
+
offchainLookupSignature,
|
|
4483
4484
|
offchainLookupAbiItem,
|
|
4484
|
-
|
|
4485
|
+
offchainLookup,
|
|
4486
|
+
ccipRequest
|
|
4485
4487
|
};
|
package/index.d.ts
CHANGED
|
@@ -673,9 +673,11 @@ declare function configureUcanStore(args: {
|
|
|
673
673
|
proxyUrl?: string | null;
|
|
674
674
|
serviceDid?: string | null;
|
|
675
675
|
serviceOrigin?: string | null;
|
|
676
|
+
publicStorageOrigin?: string | null;
|
|
676
677
|
webauthnOrigin?: string | null;
|
|
677
678
|
webauthnOriginFallbacks?: string | null;
|
|
678
679
|
adminDid?: string | null;
|
|
680
|
+
adminApiToken?: string | null;
|
|
679
681
|
bootstrapPackage?: UcanStoreBootstrapPackage | null;
|
|
680
682
|
noStart?: boolean;
|
|
681
683
|
fetch: FetchLike;
|
|
@@ -741,8 +743,10 @@ interface RelayBootstrapAuthorizationRecord {
|
|
|
741
743
|
}
|
|
742
744
|
interface RelayBootstrapProofPayload {
|
|
743
745
|
peerId: string;
|
|
744
|
-
multiaddrs
|
|
746
|
+
multiaddrs?: string[];
|
|
745
747
|
browserMultiaddrs?: string[];
|
|
748
|
+
multiaddrsHash?: string;
|
|
749
|
+
browserMultiaddrsHash?: string;
|
|
746
750
|
registrationId?: string;
|
|
747
751
|
profile?: string;
|
|
748
752
|
version?: string;
|
|
@@ -787,6 +791,7 @@ declare function waitForRelayBootstrapRegistration(args: {
|
|
|
787
791
|
postType?: string;
|
|
788
792
|
attempts?: number;
|
|
789
793
|
delayMs?: number;
|
|
794
|
+
sleep?: (ms: number) => Promise<void>;
|
|
790
795
|
onAttempt?: (match: RelayBootstrapVisibilityResult | null, attempt: number, attempts: number) => void;
|
|
791
796
|
}): Promise<RelayBootstrapVisibilityResult | null>;
|
|
792
797
|
declare function publishRelayBootstrapRegistration(args: {
|
|
@@ -802,6 +807,7 @@ declare function publishRelayBootstrapRegistration(args: {
|
|
|
802
807
|
channel?: string;
|
|
803
808
|
ref?: string;
|
|
804
809
|
postType?: string;
|
|
810
|
+
compactMultiaddrLimit?: number;
|
|
805
811
|
profile?: string;
|
|
806
812
|
version?: string;
|
|
807
813
|
ownerAddress?: string;
|
package/index.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import {
|
|
2
|
+
keccak256,
|
|
3
|
+
stringToHex
|
|
4
|
+
} from "./chunk-H2AJLDEV.js";
|
|
5
|
+
import "./chunk-3CGLGAGR.js";
|
|
1
6
|
import "./chunk-4VNS5WPM.js";
|
|
2
7
|
|
|
3
8
|
// src/constants.ts
|
|
@@ -2251,9 +2256,11 @@ async function configureUcanStore(args) {
|
|
|
2251
2256
|
proxy_url: args.proxyUrl ?? void 0,
|
|
2252
2257
|
service_did: args.serviceDid ?? void 0,
|
|
2253
2258
|
service_origin: args.serviceOrigin ?? void 0,
|
|
2259
|
+
public_storage_origin: args.publicStorageOrigin ?? void 0,
|
|
2254
2260
|
webauthn_origin: args.webauthnOrigin ?? void 0,
|
|
2255
2261
|
webauthn_origin_fallbacks: args.webauthnOriginFallbacks ?? void 0,
|
|
2256
2262
|
admin_did: args.adminDid ?? void 0,
|
|
2263
|
+
admin_api_token: args.adminApiToken ?? void 0,
|
|
2257
2264
|
bootstrap_package: args.bootstrapPackage ?? void 0,
|
|
2258
2265
|
no_start: args.noStart === true ? true : void 0
|
|
2259
2266
|
};
|
|
@@ -2409,8 +2416,10 @@ var DEFAULT_ALEPH_API_HOST2 = "https://api.aleph.im";
|
|
|
2409
2416
|
var DEFAULT_ALEPH_BOOTSTRAP_CHANNEL = "simple-todo";
|
|
2410
2417
|
var DEFAULT_ALEPH_BOOTSTRAP_REF = "simple-todo-bootstrap";
|
|
2411
2418
|
var DEFAULT_ALEPH_BOOTSTRAP_POST_TYPE = "relay-bootstrap";
|
|
2419
|
+
var DEFAULT_ALEPH_BOOTSTRAP_COMPACT_POST_TYPE = "relay-bootstrap-v2";
|
|
2412
2420
|
var DEFAULT_BOOTSTRAP_MAX_AGE_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
2413
2421
|
var DEFAULT_BOOTSTRAP_PAGINATION = 50;
|
|
2422
|
+
var DEFAULT_BOOTSTRAP_COMPACT_MULTIADDR_LIMIT = 3;
|
|
2414
2423
|
var RELAY_BOOTSTRAP_SIGNATURE_SCHEME = "personal_sign";
|
|
2415
2424
|
function serializeOwnerAuthorizationPayload(payload) {
|
|
2416
2425
|
return JSON.stringify({
|
|
@@ -2428,14 +2437,41 @@ function serializeOwnerAuthorizationPayload(payload) {
|
|
|
2428
2437
|
function serializeRelayProofPayload(payload) {
|
|
2429
2438
|
return JSON.stringify({
|
|
2430
2439
|
peerId: payload.peerId,
|
|
2431
|
-
multiaddrs: dedupeMultiaddrs(payload.multiaddrs),
|
|
2440
|
+
multiaddrs: payload.multiaddrs ? dedupeMultiaddrs(payload.multiaddrs) : void 0,
|
|
2432
2441
|
browserMultiaddrs: payload.browserMultiaddrs ? dedupeMultiaddrs(payload.browserMultiaddrs) : void 0,
|
|
2442
|
+
multiaddrsHash: payload.multiaddrsHash,
|
|
2443
|
+
browserMultiaddrsHash: payload.browserMultiaddrsHash,
|
|
2433
2444
|
registrationId: payload.registrationId,
|
|
2434
2445
|
profile: payload.profile,
|
|
2435
2446
|
version: payload.version,
|
|
2436
2447
|
updatedAt: payload.updatedAt
|
|
2437
2448
|
});
|
|
2438
2449
|
}
|
|
2450
|
+
function relayBootstrapMultiaddrsHash(addrs) {
|
|
2451
|
+
return keccak256(stringToHex(JSON.stringify(dedupeMultiaddrs(addrs))));
|
|
2452
|
+
}
|
|
2453
|
+
function compactPostType(postType) {
|
|
2454
|
+
return (postType ?? DEFAULT_ALEPH_BOOTSTRAP_COMPACT_POST_TYPE) === DEFAULT_ALEPH_BOOTSTRAP_COMPACT_POST_TYPE;
|
|
2455
|
+
}
|
|
2456
|
+
function browserMultiaddrPreference(addr) {
|
|
2457
|
+
const normalized = addr.toLowerCase();
|
|
2458
|
+
if (normalized.includes("/tcp/443/tls/ws/")) return 0;
|
|
2459
|
+
if (normalized.includes("/tls/ws/")) return 1;
|
|
2460
|
+
if (normalized.includes("/webtransport/")) return 2;
|
|
2461
|
+
if (normalized.includes("/webrtc-direct/")) return 3;
|
|
2462
|
+
if (normalized.includes("/ws")) return 4;
|
|
2463
|
+
return 5;
|
|
2464
|
+
}
|
|
2465
|
+
function selectCompactRelayBootstrapMultiaddrs(addrs, limit = DEFAULT_BOOTSTRAP_COMPACT_MULTIADDR_LIMIT) {
|
|
2466
|
+
const entries = filterPublicMultiaddrs(addrs, {
|
|
2467
|
+
browserDialableOnly: true
|
|
2468
|
+
}).map((addr, index) => ({ addr, index }));
|
|
2469
|
+
entries.sort((left, right) => {
|
|
2470
|
+
const preference = browserMultiaddrPreference(left.addr) - browserMultiaddrPreference(right.addr);
|
|
2471
|
+
return preference !== 0 ? preference : left.index - right.index;
|
|
2472
|
+
});
|
|
2473
|
+
return entries.map((entry) => entry.addr).slice(0, Math.max(1, Math.floor(limit)));
|
|
2474
|
+
}
|
|
2439
2475
|
function asTrimmedString(value) {
|
|
2440
2476
|
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
2441
2477
|
}
|
|
@@ -2591,8 +2627,10 @@ function normalizeRelayBootstrapProofPayload(value) {
|
|
|
2591
2627
|
const browserMultiaddrs = Array.isArray(payload.browserMultiaddrs) ? payload.browserMultiaddrs.filter((entry) => typeof entry === "string") : void 0;
|
|
2592
2628
|
return {
|
|
2593
2629
|
peerId,
|
|
2594
|
-
multiaddrs: dedupeMultiaddrs(multiaddrs),
|
|
2630
|
+
multiaddrs: multiaddrs.length > 0 ? dedupeMultiaddrs(multiaddrs) : void 0,
|
|
2595
2631
|
browserMultiaddrs: browserMultiaddrs ? dedupeMultiaddrs(browserMultiaddrs) : void 0,
|
|
2632
|
+
multiaddrsHash: asTrimmedString(payload.multiaddrsHash) ?? void 0,
|
|
2633
|
+
browserMultiaddrsHash: asTrimmedString(payload.browserMultiaddrsHash) ?? void 0,
|
|
2596
2634
|
registrationId: asTrimmedString(payload.registrationId) ?? void 0,
|
|
2597
2635
|
profile: asTrimmedString(payload.profile) ?? void 0,
|
|
2598
2636
|
version: asTrimmedString(payload.version) ?? void 0,
|
|
@@ -2624,16 +2662,24 @@ function normalizeRelayBootstrapPostRecord(value) {
|
|
|
2624
2662
|
function buildRelayBootstrapPostContent(args) {
|
|
2625
2663
|
const now = args.now ?? Date.now() / 1e3;
|
|
2626
2664
|
const updatedAt = args.now ?? Date.now();
|
|
2665
|
+
const postType = args.postType ?? DEFAULT_ALEPH_BOOTSTRAP_POST_TYPE;
|
|
2666
|
+
const compact = args.compact ?? compactPostType(postType);
|
|
2667
|
+
const fullMultiaddrs = filterPublicMultiaddrs(args.multiaddrs);
|
|
2668
|
+
const fullBrowserMultiaddrs = args.browserMultiaddrs ? filterPublicMultiaddrs(args.browserMultiaddrs, {
|
|
2669
|
+
browserDialableOnly: true
|
|
2670
|
+
}) : void 0;
|
|
2671
|
+
const compactMultiaddrs = selectCompactRelayBootstrapMultiaddrs(
|
|
2672
|
+
fullBrowserMultiaddrs && fullBrowserMultiaddrs.length > 0 ? fullBrowserMultiaddrs : fullMultiaddrs,
|
|
2673
|
+
args.compactMultiaddrLimit
|
|
2674
|
+
);
|
|
2627
2675
|
return {
|
|
2628
|
-
type:
|
|
2676
|
+
type: postType,
|
|
2629
2677
|
address: args.sender,
|
|
2630
2678
|
...args.ref ? { ref: args.ref } : {},
|
|
2631
2679
|
content: {
|
|
2632
2680
|
peerId: args.peerId,
|
|
2633
|
-
multiaddrs:
|
|
2634
|
-
browserMultiaddrs:
|
|
2635
|
-
browserDialableOnly: true
|
|
2636
|
-
}) : void 0,
|
|
2681
|
+
multiaddrs: compact ? compactMultiaddrs : fullMultiaddrs,
|
|
2682
|
+
browserMultiaddrs: compact ? void 0 : fullBrowserMultiaddrs,
|
|
2637
2683
|
registrationId: args.registrationId,
|
|
2638
2684
|
profile: args.profile,
|
|
2639
2685
|
version: args.version,
|
|
@@ -2663,6 +2709,8 @@ async function createRelayBootstrapPost(args) {
|
|
|
2663
2709
|
publisherAddress: args.publisherAddress,
|
|
2664
2710
|
authorization: args.authorization,
|
|
2665
2711
|
relayProof: args.relayProof,
|
|
2712
|
+
compact: args.compact,
|
|
2713
|
+
compactMultiaddrLimit: args.compactMultiaddrLimit,
|
|
2666
2714
|
now: nowMillis
|
|
2667
2715
|
});
|
|
2668
2716
|
itemContent.time = nowSeconds;
|
|
@@ -2700,12 +2748,20 @@ async function signRelayBootstrapAuthorization(args) {
|
|
|
2700
2748
|
};
|
|
2701
2749
|
}
|
|
2702
2750
|
async function signRelayBootstrapProof(args) {
|
|
2751
|
+
const fullMultiaddrs = filterPublicMultiaddrs(args.multiaddrs);
|
|
2752
|
+
const fullBrowserMultiaddrs = args.browserMultiaddrs ? filterPublicMultiaddrs(args.browserMultiaddrs, {
|
|
2753
|
+
browserDialableOnly: true
|
|
2754
|
+
}) : void 0;
|
|
2755
|
+
const compactMultiaddrs = selectCompactRelayBootstrapMultiaddrs(
|
|
2756
|
+
fullBrowserMultiaddrs && fullBrowserMultiaddrs.length > 0 ? fullBrowserMultiaddrs : fullMultiaddrs,
|
|
2757
|
+
args.compactMultiaddrLimit
|
|
2758
|
+
);
|
|
2759
|
+
const compact = args.compact ?? false;
|
|
2703
2760
|
const payload = {
|
|
2704
2761
|
peerId: args.peerId,
|
|
2705
|
-
multiaddrs:
|
|
2706
|
-
browserMultiaddrs:
|
|
2707
|
-
|
|
2708
|
-
}) : void 0,
|
|
2762
|
+
multiaddrs: compact ? void 0 : fullMultiaddrs,
|
|
2763
|
+
browserMultiaddrs: compact ? void 0 : fullBrowserMultiaddrs,
|
|
2764
|
+
multiaddrsHash: compact ? relayBootstrapMultiaddrsHash(compactMultiaddrs) : void 0,
|
|
2709
2765
|
registrationId: args.registrationId,
|
|
2710
2766
|
profile: args.profile,
|
|
2711
2767
|
version: args.version,
|
|
@@ -2752,7 +2808,7 @@ async function fetchAlephBootstrapPosts(options = {}) {
|
|
|
2752
2808
|
throw new Error(`Aleph bootstrap post lookup failed: ${response.status}`);
|
|
2753
2809
|
}
|
|
2754
2810
|
const payload = await response.json();
|
|
2755
|
-
return (payload.posts ?? []).map((entry) => normalizeRelayBootstrapPostRecord(entry)).filter((entry) => entry != null);
|
|
2811
|
+
return (payload.posts ?? []).map((entry) => normalizeRelayBootstrapPostRecord(entry)).filter((entry) => entry != null).sort((left, right) => compareRelayBootstrapPostRecency(right, left));
|
|
2756
2812
|
}
|
|
2757
2813
|
function compareRelayBootstrapPostRecency(left, right) {
|
|
2758
2814
|
const leftUpdatedAt = left.content?.updatedAt ?? 0;
|
|
@@ -2799,12 +2855,14 @@ async function waitForRelayBootstrapRegistration(args) {
|
|
|
2799
2855
|
const expectedSender = args.sender?.trim().toLowerCase() || null;
|
|
2800
2856
|
const expectedRegistrationId = args.registrationId?.trim() || null;
|
|
2801
2857
|
const expectedPeerId = args.peerId?.trim() || null;
|
|
2858
|
+
const postType = args.postType ?? DEFAULT_ALEPH_BOOTSTRAP_COMPACT_POST_TYPE;
|
|
2859
|
+
const sleepImpl = args.sleep ?? sleep;
|
|
2802
2860
|
for (let attempt = 0; attempt < attempts; attempt += 1) {
|
|
2803
2861
|
const posts = await fetchAlephBootstrapPosts({
|
|
2804
2862
|
apiHost: args.apiHost ?? DEFAULT_ALEPH_API_HOST2,
|
|
2805
2863
|
channel: args.channel,
|
|
2806
2864
|
ref: args.ref,
|
|
2807
|
-
postType
|
|
2865
|
+
postType,
|
|
2808
2866
|
fetch: args.fetch
|
|
2809
2867
|
});
|
|
2810
2868
|
const currentPosts = selectCurrentRelayBootstrapPosts(posts);
|
|
@@ -2835,7 +2893,7 @@ async function waitForRelayBootstrapRegistration(args) {
|
|
|
2835
2893
|
}
|
|
2836
2894
|
args.onAttempt?.(null, attempt + 1, attempts);
|
|
2837
2895
|
if (attempt < attempts - 1) {
|
|
2838
|
-
await
|
|
2896
|
+
await sleepImpl(delayMs);
|
|
2839
2897
|
}
|
|
2840
2898
|
}
|
|
2841
2899
|
return null;
|
|
@@ -2843,6 +2901,8 @@ async function waitForRelayBootstrapRegistration(args) {
|
|
|
2843
2901
|
async function publishRelayBootstrapRegistration(args) {
|
|
2844
2902
|
const publisherAddress = args.publisherAddress ?? args.sender;
|
|
2845
2903
|
const ownerAddress = args.ownerAddress;
|
|
2904
|
+
const postType = args.postType ?? DEFAULT_ALEPH_BOOTSTRAP_COMPACT_POST_TYPE;
|
|
2905
|
+
const compact = postType === DEFAULT_ALEPH_BOOTSTRAP_COMPACT_POST_TYPE;
|
|
2846
2906
|
let ownerAuthorization = args.ownerAuthorization;
|
|
2847
2907
|
let relayProof = args.relayProof;
|
|
2848
2908
|
if (!ownerAuthorization && ownerAddress && args.ownerSigner) {
|
|
@@ -2869,6 +2929,8 @@ async function publishRelayBootstrapRegistration(args) {
|
|
|
2869
2929
|
profile: args.profile,
|
|
2870
2930
|
version: args.version,
|
|
2871
2931
|
updatedAt: args.now ?? Date.now(),
|
|
2932
|
+
compact,
|
|
2933
|
+
compactMultiaddrLimit: args.compactMultiaddrLimit,
|
|
2872
2934
|
signer: args.publisherSigner
|
|
2873
2935
|
});
|
|
2874
2936
|
}
|
|
@@ -2880,13 +2942,15 @@ async function publishRelayBootstrapRegistration(args) {
|
|
|
2880
2942
|
registrationId: args.registrationId,
|
|
2881
2943
|
channel: args.channel,
|
|
2882
2944
|
ref: args.ref,
|
|
2883
|
-
postType
|
|
2945
|
+
postType,
|
|
2884
2946
|
profile: args.profile,
|
|
2885
2947
|
version: args.version,
|
|
2886
2948
|
ownerAddress,
|
|
2887
2949
|
publisherAddress,
|
|
2888
2950
|
authorization: ownerAuthorization,
|
|
2889
2951
|
relayProof,
|
|
2952
|
+
compact,
|
|
2953
|
+
compactMultiaddrLimit: args.compactMultiaddrLimit,
|
|
2890
2954
|
now: args.now,
|
|
2891
2955
|
hasher: args.hasher
|
|
2892
2956
|
});
|
|
@@ -2908,16 +2972,33 @@ async function publishRelayBootstrapRegistration(args) {
|
|
|
2908
2972
|
let forgottenHashes = [];
|
|
2909
2973
|
let forgetResult;
|
|
2910
2974
|
if (args.forgetPrevious && args.registrationId) {
|
|
2911
|
-
const
|
|
2912
|
-
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2975
|
+
const previousPostTypes = compact ? [postType, DEFAULT_ALEPH_BOOTSTRAP_POST_TYPE] : [postType];
|
|
2976
|
+
const previousPosts = (await Promise.all(
|
|
2977
|
+
previousPostTypes.map(
|
|
2978
|
+
(previousPostType) => fetchAlephBootstrapPosts({
|
|
2979
|
+
apiHost: args.apiHost ?? DEFAULT_ALEPH_API_HOST2,
|
|
2980
|
+
channel: args.channel,
|
|
2981
|
+
ref: args.ref,
|
|
2982
|
+
postType: previousPostType,
|
|
2983
|
+
fetch: args.fetch
|
|
2984
|
+
})
|
|
2985
|
+
)
|
|
2986
|
+
)).flat();
|
|
2987
|
+
const forgottenHashSet = new Set(
|
|
2988
|
+
previousPosts.filter((post) => {
|
|
2989
|
+
const hash = post.itemHash ?? post.hash;
|
|
2990
|
+
if (!hash || hash === unsigned.item_hash) return false;
|
|
2991
|
+
if (post.address?.toLowerCase() !== args.sender.toLowerCase()) {
|
|
2992
|
+
return false;
|
|
2993
|
+
}
|
|
2994
|
+
const content2 = post.content;
|
|
2995
|
+
if (!content2) return false;
|
|
2996
|
+
if (content2.registrationId === args.registrationId) return true;
|
|
2997
|
+
if (content2.peerId !== args.peerId) return false;
|
|
2998
|
+
return !args.profile || content2.profile === args.profile;
|
|
2999
|
+
}).map((post) => post.itemHash ?? post.hash ?? "").filter(Boolean)
|
|
3000
|
+
);
|
|
3001
|
+
forgottenHashes = [...forgottenHashSet];
|
|
2921
3002
|
if (forgottenHashes.length > 0) {
|
|
2922
3003
|
forgetResult = await forgetAlephMessages({
|
|
2923
3004
|
sender: args.sender,
|
|
@@ -2938,7 +3019,7 @@ async function publishRelayBootstrapRegistration(args) {
|
|
|
2938
3019
|
response,
|
|
2939
3020
|
httpStatus,
|
|
2940
3021
|
publishedMultiaddrs: content.content?.multiaddrs ?? [],
|
|
2941
|
-
publishedBrowserMultiaddrs: content.content?.browserMultiaddrs ?? [],
|
|
3022
|
+
publishedBrowserMultiaddrs: content.content?.browserMultiaddrs ?? content.content?.multiaddrs ?? [],
|
|
2942
3023
|
forgottenHashes,
|
|
2943
3024
|
forgetResult
|
|
2944
3025
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@le-space/core",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5",
|
|
4
4
|
"description": "Reusable Aleph deployment, runtime, and guest lifecycle logic.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"url": "https://github.com/NiKrause/relay-button/issues"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@le-space/aleph-bootstrap": "0.6.
|
|
28
|
-
"@le-space/shared-types": "0.6.
|
|
27
|
+
"@le-space/aleph-bootstrap": "0.6.5",
|
|
28
|
+
"@le-space/shared-types": "0.6.5"
|
|
29
29
|
}
|
|
30
30
|
}
|