@arca-network/sdk 2.14.0 → 2.16.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/arca.d.ts +31 -11
- package/dist/arca.d.ts.map +1 -1
- package/dist/arca.js +57 -19
- package/dist/arca.js.map +1 -1
- package/dist/atlas-ownership.d.ts +52 -31
- package/dist/atlas-ownership.d.ts.map +1 -1
- package/dist/atlas-ownership.js +108 -18
- package/dist/atlas-ownership.js.map +1 -1
- package/dist/atlas-wallet.d.ts.map +1 -1
- package/dist/atlas-wallet.js +5 -2
- package/dist/atlas-wallet.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/money.d.ts +4 -1
- package/dist/money.d.ts.map +1 -1
- package/dist/money.js +13 -1
- package/dist/money.js.map +1 -1
- package/dist/revalue.d.ts +12 -6
- package/dist/revalue.d.ts.map +1 -1
- package/dist/revalue.js +116 -18
- package/dist/revalue.js.map +1 -1
- package/dist/streams.d.ts +38 -2
- package/dist/streams.d.ts.map +1 -1
- package/dist/streams.js +103 -17
- package/dist/streams.js.map +1 -1
- package/dist/types.d.ts +172 -22
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/websocket.d.ts +13 -5
- package/dist/websocket.d.ts.map +1 -1
- package/dist/websocket.js +18 -9
- package/dist/websocket.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,14 +5,14 @@ export interface AtlasTypedData {
|
|
|
5
5
|
name: string;
|
|
6
6
|
version: string;
|
|
7
7
|
chainId: string | number;
|
|
8
|
-
|
|
8
|
+
salt?: string;
|
|
9
9
|
};
|
|
10
10
|
primaryType: string;
|
|
11
11
|
types: Record<string, {
|
|
12
12
|
name: string;
|
|
13
13
|
type: string;
|
|
14
14
|
}[]>;
|
|
15
|
-
message: Record<string,
|
|
15
|
+
message: Record<string, unknown>;
|
|
16
16
|
}
|
|
17
17
|
export interface AtlasOwnerConsent {
|
|
18
18
|
ownerAddress: string;
|
|
@@ -20,52 +20,73 @@ export interface AtlasOwnerConsent {
|
|
|
20
20
|
deadline: string;
|
|
21
21
|
signature: string;
|
|
22
22
|
}
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
export type AtlasNetwork = 'mainnet' | 'testnet' | 'devnet';
|
|
24
|
+
/** Owner-signed Atlas actions. The owner's wallet is the venue account, so only
|
|
25
|
+
* the owner can enable trading on it or bind the platform's agent key to it. */
|
|
26
|
+
export type AtlasOwnerAction = 'enableTrading' | 'bindTradingKey';
|
|
27
|
+
export interface AtlasTermsAcceptance {
|
|
28
|
+
id: string;
|
|
29
|
+
version: string;
|
|
30
|
+
contentHash: string;
|
|
31
|
+
}
|
|
32
|
+
/** One owner-signed Atlas action with every field the owner's wallet signs. */
|
|
33
|
+
export interface AtlasOwnerRequest {
|
|
34
|
+
action: AtlasOwnerAction;
|
|
35
|
+
network: AtlasNetwork;
|
|
36
|
+
chainId: string;
|
|
37
|
+
signer: string;
|
|
28
38
|
nonce: string;
|
|
29
|
-
|
|
30
|
-
|
|
39
|
+
accountAddress: string;
|
|
40
|
+
/** enableTrading: the Atlas Protocol Trading Terms being accepted. */
|
|
41
|
+
terms?: AtlasTermsAcceptance;
|
|
42
|
+
/** bindTradingKey: the platform agent key, its expiry and scope. */
|
|
43
|
+
agentPubkeyX?: string;
|
|
44
|
+
agentPubkeyY?: string;
|
|
45
|
+
expiresAtNs?: string;
|
|
46
|
+
scope?: 'trading_only';
|
|
47
|
+
/** bindTradingKey: the delivery connection's handshake, also owner-signed. */
|
|
48
|
+
handshakeNonce?: string;
|
|
49
|
+
handshakeTsMs?: string;
|
|
31
50
|
}
|
|
32
|
-
export interface
|
|
33
|
-
request:
|
|
51
|
+
export interface PreparedAtlasOwnerAction {
|
|
52
|
+
request: AtlasOwnerRequest;
|
|
53
|
+
/** Rebuilt by the SDK from `request`. This is what the owner signs. */
|
|
34
54
|
typedData: AtlasTypedData;
|
|
35
|
-
|
|
55
|
+
/** bindTradingKey only: the connection handshake the owner also signs. */
|
|
56
|
+
handshakeTypedData?: AtlasTypedData;
|
|
36
57
|
notice: string;
|
|
37
58
|
}
|
|
38
59
|
export interface AtlasAccountAccess {
|
|
39
60
|
ownership: 'user';
|
|
40
61
|
venueOrigin: string;
|
|
41
|
-
|
|
62
|
+
/** The owner's wallet address, which is the Atlas account. */
|
|
63
|
+
accountAddress: string;
|
|
42
64
|
owner: {
|
|
43
65
|
address: string;
|
|
44
66
|
pubkeyX: string;
|
|
45
67
|
pubkeyY: string;
|
|
46
|
-
entropy: string;
|
|
47
68
|
};
|
|
69
|
+
agentAddress: string;
|
|
48
70
|
agentPubkeyX: string;
|
|
49
71
|
agentPubkeyY: string;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
expiry: string;
|
|
56
|
-
grantSeq: string;
|
|
57
|
-
};
|
|
72
|
+
/** A state the venue did not report is `unavailable`, never absent. */
|
|
73
|
+
trading: 'enabled' | 'not_enabled' | 'unavailable';
|
|
74
|
+
delegation: 'bound' | 'unbound' | 'unavailable';
|
|
75
|
+
/** The bound agent key's scope as the venue reports it. */
|
|
76
|
+
delegationScope?: string;
|
|
58
77
|
capabilities: Record<string, boolean>;
|
|
59
78
|
}
|
|
60
|
-
/**
|
|
61
|
-
*
|
|
62
|
-
* not a secret/key. A different salt identifies a different native account. */
|
|
79
|
+
/** Generate once per create and retain it across retries. This is public salt,
|
|
80
|
+
* not a secret: it binds an owner consent to one create. */
|
|
63
81
|
export declare function newAtlasAccountSalt(): string;
|
|
64
|
-
/**
|
|
82
|
+
/** The owner consent a user-owned Atlas account is created with. Its domain is
|
|
83
|
+
* separate from Atlas transactions: consent cannot authorize trading. */
|
|
65
84
|
export declare function atlasOwnerConsentTypedData(realmId: string, path: string, consent: Omit<AtlasOwnerConsent, 'signature'>): AtlasTypedData;
|
|
66
|
-
/**
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
85
|
+
/** Rebuild the typed data an owner signs for `request`, refusing any field the
|
|
86
|
+
* owner should not sign: another signer, another account, or a delegation wider
|
|
87
|
+
* than Trading Only or without an expiry. */
|
|
88
|
+
export declare function atlasOwnerActionTypedData(request: AtlasOwnerRequest): AtlasTypedData;
|
|
89
|
+
/** The connection handshake a bindTradingKey request is delivered over. The
|
|
90
|
+
* owner signs it too; it authenticates the connection and authorizes nothing. */
|
|
91
|
+
export declare function atlasHandshakeTypedData(request: AtlasOwnerRequest): AtlasTypedData;
|
|
71
92
|
//# sourceMappingURL=atlas-ownership.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atlas-ownership.d.ts","sourceRoot":"","sources":["../src/atlas-ownership.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"atlas-ownership.d.ts","sourceRoot":"","sources":["../src/atlas-ownership.ts"],"names":[],"mappings":"AAEA;oFACoF;AACpF,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnF,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC,CAAC;IACxD,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AACD,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED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IAC7D,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,OAAO,EAAE,SAAS,GAAG,aAAa,GAAG,aAAa,CAAC;IACnD,UAAU,EAAE,OAAO,GAAG,SAAS,GAAG,aAAa,CAAC;IAChD,2DAA2D;IAC3D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACvC;AAED;4DAC4D;AAC5D,wBAAgB,mBAAmB,IAAI,MAAM,CAI5C;AAED;yEACyE;AACzE,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,iBAAiB,EAAE,WAAW,CAAC,GAAG,cAAc,CAcvI;AAkCD;;6CAE6C;AAC7C,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,iBAAiB,GAAG,cAAc,CA4CpF;AAED;iFACiF;AACjF,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,iBAAiB,GAAG,cAAc,CAgBlF"}
|
package/dist/atlas-ownership.js
CHANGED
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.newAtlasAccountSalt = newAtlasAccountSalt;
|
|
4
4
|
exports.atlasOwnerConsentTypedData = atlasOwnerConsentTypedData;
|
|
5
|
-
exports.
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* not a secret
|
|
5
|
+
exports.atlasOwnerActionTypedData = atlasOwnerActionTypedData;
|
|
6
|
+
exports.atlasHandshakeTypedData = atlasHandshakeTypedData;
|
|
7
|
+
const eip712_1 = require("./eip712");
|
|
8
|
+
/** Generate once per create and retain it across retries. This is public salt,
|
|
9
|
+
* not a secret: it binds an owner consent to one create. */
|
|
10
10
|
function newAtlasAccountSalt() {
|
|
11
11
|
const bytes = new Uint8Array(32);
|
|
12
12
|
globalThis.crypto.getRandomValues(bytes);
|
|
13
13
|
return '0x' + Array.from(bytes, b => b.toString(16).padStart(2, '0')).join('');
|
|
14
14
|
}
|
|
15
|
-
/**
|
|
15
|
+
/** The owner consent a user-owned Atlas account is created with. Its domain is
|
|
16
|
+
* separate from Atlas transactions: consent cannot authorize trading. */
|
|
16
17
|
function atlasOwnerConsentTypedData(realmId, path, consent) {
|
|
17
18
|
if (!realmId || !path.startsWith('/'))
|
|
18
19
|
throw new Error('Atlas consent requires the resolved realm ID and absolute object path');
|
|
@@ -20,7 +21,7 @@ function atlasOwnerConsentTypedData(realmId, path, consent) {
|
|
|
20
21
|
throw new Error('Atlas requires an EOA owner wallet address');
|
|
21
22
|
if (!/^0x[\da-f]{64}$/i.test(consent.accountSalt) || /^0x0+$/.test(consent.accountSalt))
|
|
22
23
|
throw new Error('Retain a nonzero 32-byte account salt');
|
|
23
|
-
if (!/^\d+$/.test(consent.deadline) || BigInt(consent.deadline) <= 0n || BigInt(consent.deadline) >
|
|
24
|
+
if (!/^\d+$/.test(consent.deadline) || BigInt(consent.deadline) <= 0n || BigInt(consent.deadline) > U64_MAX)
|
|
24
25
|
throw new Error('Invalid Atlas consent deadline');
|
|
25
26
|
return {
|
|
26
27
|
domain: { name: 'Gobi Atlas Account Ownership', version: '1', chainId: 1337 },
|
|
@@ -32,21 +33,110 @@ function atlasOwnerConsentTypedData(realmId, path, consent) {
|
|
|
32
33
|
message: { venue: 'https://testnet.gll.dev', realmId, path, owner: consent.ownerAddress, accountSalt: consent.accountSalt, deadline: consent.deadline },
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
const U64_MAX = (1n << 64n) - 1n;
|
|
37
|
+
const NETWORKS = ['mainnet', 'testnet', 'devnet'];
|
|
38
|
+
const DOMAIN_TYPE = [{ name: 'name', type: 'string' }, { name: 'version', type: 'string' }, { name: 'chainId', type: 'uint256' }, { name: 'salt', type: 'bytes32' }];
|
|
39
|
+
const TRADING_ONLY_SCOPE = '0';
|
|
40
|
+
const HANDSHAKE_PURPOSE = 'gateway-rest/ws/v2';
|
|
41
|
+
function u64(value, field, allowZero = false) {
|
|
42
|
+
if (!value || !/^\d+$/.test(value))
|
|
43
|
+
throw new Error(`Atlas ${field} must be a decimal u64`);
|
|
44
|
+
const v = BigInt(value);
|
|
45
|
+
if (v > U64_MAX || (!allowZero && v === 0n))
|
|
46
|
+
throw new Error(`Atlas ${field} is out of range`);
|
|
47
|
+
return v.toString();
|
|
38
48
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
49
|
+
function address(value, field) {
|
|
50
|
+
if (!value || !/^0x[\da-f]{40}$/i.test(value) || /^0x0+$/i.test(value))
|
|
51
|
+
throw new Error(`Atlas ${field} must be a 20-byte 0x address`);
|
|
52
|
+
return value.toLowerCase();
|
|
53
|
+
}
|
|
54
|
+
function bytes32(value, field) {
|
|
55
|
+
if (!value || !/^0x[\da-f]{64}$/i.test(value))
|
|
56
|
+
throw new Error(`Atlas ${field} must be 0x-prefixed 32-byte hex`);
|
|
57
|
+
return value.toLowerCase();
|
|
58
|
+
}
|
|
59
|
+
/** The salted Atlas domain: keccak256("atlas/<network>") for transactions,
|
|
60
|
+
* keccak256("atlas/<network>/auth") for the connection handshake. */
|
|
61
|
+
function atlasDomain(network, chainId, auth) {
|
|
62
|
+
if (!NETWORKS.includes(network))
|
|
63
|
+
throw new Error(`Unknown Atlas network ${network}`);
|
|
64
|
+
const id = BigInt(u64(chainId, 'chainId'));
|
|
65
|
+
if (id > BigInt(Number.MAX_SAFE_INTEGER))
|
|
66
|
+
throw new Error('Atlas chainId is out of range');
|
|
67
|
+
return { name: 'atlas', version: '1', chainId: Number(id), salt: '0x' + (0, eip712_1.bytesToHex)((0, eip712_1.keccak256)((0, eip712_1.utf8)(`atlas/${network}${auth ? '/auth' : ''}`))) };
|
|
68
|
+
}
|
|
69
|
+
/** Rebuild the typed data an owner signs for `request`, refusing any field the
|
|
70
|
+
* owner should not sign: another signer, another account, or a delegation wider
|
|
71
|
+
* than Trading Only or without an expiry. */
|
|
72
|
+
function atlasOwnerActionTypedData(request) {
|
|
73
|
+
const signer = address(request.signer, 'signer');
|
|
74
|
+
const account = address(request.accountAddress, 'accountAddress');
|
|
75
|
+
if (signer !== account)
|
|
76
|
+
throw new Error('An Atlas owner action is signed by the account owner itself');
|
|
77
|
+
const nonce = u64(request.nonce, 'nonce');
|
|
78
|
+
const types = { EIP712Domain: DOMAIN_TYPE };
|
|
79
|
+
let actionType;
|
|
80
|
+
let action;
|
|
81
|
+
switch (request.action) {
|
|
82
|
+
case 'enableTrading': {
|
|
83
|
+
const terms = request.terms;
|
|
84
|
+
if (!terms?.id || !terms.version)
|
|
85
|
+
throw new Error('enableTrading carries the Atlas Protocol Trading Terms');
|
|
86
|
+
if (request.agentPubkeyX || request.agentPubkeyY || request.expiresAtNs || request.scope)
|
|
87
|
+
throw new Error('enableTrading carries the Protocol Trading Terms and nothing else');
|
|
88
|
+
actionType = 'EnableTrading';
|
|
89
|
+
types.EnableTrading = [{ name: 'wallet', type: 'address' }, { name: 'protocolTradingTerms', type: 'TermsAcceptance' }, { name: 'hasStampBuilderId', type: 'bool' }, { name: 'stampBuilderId', type: 'bytes32' }];
|
|
90
|
+
types.TermsAcceptance = [{ name: 'id', type: 'string' }, { name: 'version', type: 'string' }, { name: 'contentHash', type: 'bytes32' }];
|
|
91
|
+
action = {
|
|
92
|
+
wallet: account,
|
|
93
|
+
protocolTradingTerms: { id: terms.id, version: terms.version, contentHash: bytes32(terms.contentHash, 'terms contentHash') },
|
|
94
|
+
hasStampBuilderId: false,
|
|
95
|
+
stampBuilderId: '0x' + '00'.repeat(32),
|
|
96
|
+
};
|
|
97
|
+
break;
|
|
98
|
+
}
|
|
99
|
+
case 'bindTradingKey': {
|
|
100
|
+
if (request.terms)
|
|
101
|
+
throw new Error('bindTradingKey carries no terms');
|
|
102
|
+
if (request.scope !== 'trading_only')
|
|
103
|
+
throw new Error('The platform agent may only be bound with the Trading Only scope');
|
|
104
|
+
actionType = 'BindTradingKey';
|
|
105
|
+
types.BindTradingKey = [{ name: 'accountAddress', type: 'address' }, { name: 'agentPubkeyX', type: 'bytes32' }, { name: 'agentPubkeyY', type: 'bytes32' }, { name: 'expires', type: 'bool' }, { name: 'expiresAtNs', type: 'uint64' }, { name: 'scope', type: 'uint8' }];
|
|
106
|
+
action = {
|
|
107
|
+
accountAddress: account,
|
|
108
|
+
agentPubkeyX: bytes32(request.agentPubkeyX, 'agentPubkeyX'),
|
|
109
|
+
agentPubkeyY: bytes32(request.agentPubkeyY, 'agentPubkeyY'),
|
|
110
|
+
expires: true,
|
|
111
|
+
expiresAtNs: u64(request.expiresAtNs, 'expiresAtNs'),
|
|
112
|
+
scope: TRADING_ONLY_SCOPE,
|
|
113
|
+
};
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
default:
|
|
117
|
+
throw new Error('Atlas owner action must be enableTrading or bindTradingKey');
|
|
118
|
+
}
|
|
119
|
+
types.Transaction = [{ name: 'signer', type: 'address' }, { name: 'nonce', type: 'uint64' }, { name: 'action', type: actionType }];
|
|
120
|
+
return { domain: atlasDomain(request.network, request.chainId, false), primaryType: 'Transaction', types, message: { signer, nonce, action } };
|
|
121
|
+
}
|
|
122
|
+
/** The connection handshake a bindTradingKey request is delivered over. The
|
|
123
|
+
* owner signs it too; it authenticates the connection and authorizes nothing. */
|
|
124
|
+
function atlasHandshakeTypedData(request) {
|
|
125
|
+
if (request.action !== 'bindTradingKey')
|
|
126
|
+
throw new Error('Only bindTradingKey is delivered over the owner-signed connection');
|
|
42
127
|
return {
|
|
43
|
-
domain:
|
|
44
|
-
primaryType: '
|
|
128
|
+
domain: atlasDomain(request.network, request.chainId, true),
|
|
129
|
+
primaryType: 'RetailWsHandshake',
|
|
45
130
|
types: {
|
|
46
|
-
EIP712Domain:
|
|
47
|
-
|
|
131
|
+
EIP712Domain: DOMAIN_TYPE,
|
|
132
|
+
RetailWsHandshake: [{ name: 'purpose', type: 'string' }, { name: 'accountAddress', type: 'address' }, { name: 'nonce', type: 'uint64' }, { name: 'tsMs', type: 'uint64' }],
|
|
133
|
+
},
|
|
134
|
+
message: {
|
|
135
|
+
purpose: HANDSHAKE_PURPOSE,
|
|
136
|
+
accountAddress: address(request.accountAddress, 'accountAddress'),
|
|
137
|
+
nonce: u64(request.handshakeNonce, 'handshakeNonce', true),
|
|
138
|
+
tsMs: u64(request.handshakeTsMs, 'handshakeTsMs'),
|
|
48
139
|
},
|
|
49
|
-
message: { purpose: 'atlas.createAccount' },
|
|
50
140
|
};
|
|
51
141
|
}
|
|
52
142
|
//# sourceMappingURL=atlas-ownership.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atlas-ownership.js","sourceRoot":"","sources":["../src/atlas-ownership.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"atlas-ownership.js","sourceRoot":"","sources":["../src/atlas-ownership.ts"],"names":[],"mappings":";;AA6EA,kDAIC;AAID,gEAcC;AAqCD,8DA4CC;AAID,0DAgBC;AAxMD,qCAAuD;AA2EvD;4DAC4D;AAC5D,SAAgB,mBAAmB;IACjC,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC,CAAC;IACjC,UAAU,CAAC,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IACzC,OAAO,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACjF,CAAC;AAED;yEACyE;AACzE,SAAgB,0BAA0B,CAAC,OAAe,EAAE,IAAY,EAAE,OAA6C;IACrH,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,UA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3,"file":"atlas-wallet.d.ts","sourceRoot":"","sources":["../src/atlas-wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD;4EAC4E;AAC5E,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,EAAE,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACzE;AACD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACrD;AACD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,SAAS,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAClD;AAKD;8DAC8D;AAC9D,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,oBAAoB,GAAG,SAAS,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAyBxI"}
|
package/dist/atlas-wallet.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createAtlasOwnerSigner = createAtlasOwnerSigner;
|
|
4
|
+
/** The message field naming the wallet each owner prompt is for. */
|
|
5
|
+
const ownerField = { CreateAtlasAccount: 'owner', Transaction: 'signer', RetailWsHandshake: 'accountAddress' };
|
|
4
6
|
/** Select a connected wallet explicitly; do not take wallets[0] or fall back
|
|
5
7
|
* to another provider when the intended owner disconnects. */
|
|
6
8
|
async function createAtlasOwnerSigner(wallet, expectedOwner) {
|
|
@@ -24,8 +26,9 @@ async function createAtlasOwnerSigner(wallet, expectedOwner) {
|
|
|
24
26
|
address,
|
|
25
27
|
async sign(typedData) {
|
|
26
28
|
const provider = await requireAccount();
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
const target = ownerField[typedData.primaryType];
|
|
30
|
+
if (target && String(typedData.message[target] ?? '').toLowerCase() !== address.toLowerCase())
|
|
31
|
+
throw new Error('This Atlas authorization targets a different wallet');
|
|
29
32
|
const signature = await provider.request({ method: 'eth_signTypedData_v4', params: [address, JSON.stringify(typedData)] });
|
|
30
33
|
if (typeof signature !== 'string' || !/^0x[\da-f]{130}$/i.test(signature))
|
|
31
34
|
throw new Error('The owner wallet did not return a 65-byte signature');
|
package/dist/atlas-wallet.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atlas-wallet.js","sourceRoot":"","sources":["../src/atlas-wallet.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"atlas-wallet.js","sourceRoot":"","sources":["../src/atlas-wallet.ts"],"names":[],"mappings":";;AAsBA,wDAyBC;AA9BD,oEAAoE;AACpE,MAAM,UAAU,GAA2B,EAAE,kBAAkB,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;AAEvI;8DAC8D;AACvD,KAAK,UAAU,sBAAsB,CAAC,MAAwC,EAAE,aAAsB;IAC3G,IAAI,CAAC,MAAM;QAAE,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IAC5E,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAC/B,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC/G,IAAI,aAAa,IAAI,aAAa,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC,WAAW,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,aAAa,EAAE,CAAC,CAAC;IAC/I,MAAM,cAAc,GAAG,KAAK,IAAI,EAAE;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CAAC;QACnB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export { createAtlasOwnerSigner } from './atlas-wallet';
|
|
2
2
|
export type { AtlasWalletProvider, AtlasConnectedWallet, AtlasOwnerSigner } from './atlas-wallet';
|
|
3
|
-
export { atlasOwnerConsentTypedData,
|
|
4
|
-
export type { AtlasOwnerConsent, AtlasTypedData,
|
|
3
|
+
export { atlasOwnerConsentTypedData, atlasOwnerActionTypedData, atlasHandshakeTypedData, newAtlasAccountSalt } from './atlas-ownership';
|
|
4
|
+
export type { AtlasOwnerConsent, AtlasTypedData, AtlasNetwork, AtlasOwnerAction, AtlasOwnerRequest, AtlasTermsAcceptance, PreparedAtlasOwnerAction, AtlasAccountAccess } from './atlas-ownership';
|
|
5
5
|
export { Arca, computeChartRange } from './arca';
|
|
6
6
|
export type { ChartRangePreset } from './arca';
|
|
7
7
|
export { PROVIDER_EVIDENCE_PRIVY_IDENTITY_TOKEN } from './providers';
|
|
8
8
|
export type { AddressObservationView, ConnectProviderOptions, CreateDepositLinkOptions, DepositLink, DepositLinkProgress, DepositRouteStatus, EnsureProviderOptions, ProviderDetail, ProviderEvidence, ProviderState, ProviderWallet, ProviderWalletControl, UpdateProviderWalletOptions, } from './providers';
|
|
9
9
|
export { ArcaAdmin } from './admin';
|
|
10
10
|
export { WebSocketManager } from './websocket';
|
|
11
|
-
export type { GapInfo, GapCallback } from './websocket';
|
|
11
|
+
export type { GapInfo, GapCallback, ProjectionWatchReply } from './websocket';
|
|
12
12
|
export { OperationHandle, OrderHandle } from './operation-handle';
|
|
13
13
|
export { OperationWatchStream, BalanceWatchStream, ObjectWatchStream, ObjectsWatchStream, AggregationWatchStream, ProjectionWatchStream, EquityChartStream, PnlChartStream, MaxOrderSizeWatchStream, PriceWatchStream, CandleWatchStream, OIWatchStream, CandleChartStream, CoverageTracker, ExchangeWatchStream, TradeWatchStream, TwapWatchStream, FillWatchStream, RealmFillWatchStream, RealmExchangeWatchStream, FundingWatchStream, WatchStreamReadyTimeoutError, getMarketAvailability, availabilityDivergenceUsd, } from './streams';
|
|
14
14
|
export type { WatchStreamState, OperationUpdate, BalanceSnapshot, BalanceUpdate, EquityChartUpdate, PnlChartUpdate, MaxOrderSizeUpdate, MaxOrderSizePendingReason, FundingUpdate, MaxOrderSizeWatchOptions, ExchangeStateUpdate, TwapUpdate, FillUpdate, RealmFillUpdate, RealmExchangeUpdate, InitialHistoryState, } from './streams';
|
|
@@ -16,7 +16,7 @@ export type { WatchStreamState, OperationUpdate, BalanceSnapshot, BalanceUpdate,
|
|
|
16
16
|
export type { MarketPriceStream } from './arca';
|
|
17
17
|
export type { PnlHistoryAnchor, PnlHistoryOptions, HistoryScopeOptions, WatchPricesOptions } from './arca';
|
|
18
18
|
export type { WaitOptions, OrderHandleDeps } from './operation-handle';
|
|
19
|
-
export type { TokenProvider, AuthErrorListener, ArcaConfig, ArcaApiKeyConfig, ArcaTokenConfig, ArcaObject, ArcaObjectType, ArcaObjectStatus, IsolationInfo, ArcaObjectListResponse, ArcaObjectBrowseResponse, BrowsePathEntry, BrowsePathKind, ArcaObjectDetailResponse, ArcaObjectVersionsResponse, IsolationZone, ArcaBalance, ArcaBalanceListResponse, EnsureArcaObjectResponse, DeleteArcaObjectResponse, Operation, OperationType, OperationState, OperationListResponse, OperationDetailResponse, OperationEvidence, OperationEvidenceJournal, OperationEvidenceIntegrity, OperationEvidenceExportResponse, JournalEntryEvidence, JournalLegEvidence, JournalProofEvidence, ChainTransactionEvidence, IntegrityAnnotation, ProofUniquenessEvidence, CryptographicSequenceState, OperationContext, FillContext, FeeBreakdown, TransferContext, DepositContext, WithdrawalContext, OrderPlacedContext, CancelContext, DeleteContext, ArcaEvent, EventListResponse, EventDetailResponse, StateDelta, DeltaType, StateDeltaListResponse, FundAccountResponse, TransferResponse, VenueHopProposal, VenueHopSubmission, CosignDomain, NonceResponse, ExplorerSummary, BatchSummariesResponse, CanonicalPosition, SnapshotBalancesResponse, AssetBreakdown, BalanceValue, PositionValue, ReservedValue, ObjectValuation, PathAggregation, RealmProjection, ProjectedValuation, ProjectionValuationsPage, GetProjectionValuationsOptions, ProjectionWatchScope, WatchProjectionOptions, PnlResponse, PnlHistoryResponse, PnlPoint, PnlChartBaseline, ExternalFlowEntry, EquityHistoryResponse, EquityPoint, AggregationSourceDto, CreateWatchResponse, WatchAggregationOptions, Watermark, ConsistentReadScope, ConsistentReadValue, ConsistentReadResult, ReconciliationState, ReconciliationStateListResponse, BuilderProfile, AuthResponse, RefreshResponse, ApiKeyStatus, ApiKey, ApiKeyPermissions, CreateApiKeyOptions, ApiKeyCreatedResponse, ApiKeyListResponse, BrowseObjectsOptions, CreateIsolationZoneOptions, ListIsolationZonesOptions, IsolationZoneListResponse, ArchiveIsolationZoneOptions, Realm, RealmSettings, RealmType, RealmAsset, RealmLifecycle, RealmBacking, CreateRealmAxes, EnsureDenominatedArcaOptions, EnsureArcaOptions, EnsureInfoOptions, UpdateLabelsOptions, FolderLabelsResponse, UpdateFolderLabelsRequest, PatchFolderLabelsRequest, EnsureDeletedOptions, TransferOptions, HopVenuesOptions, ProposeVenueHopOptions, SubmitVenueHopOptions, CosignDigestSigner, FundAccountOptions, QuoteDepositFeeOptions, CctpFeeQuote, CorridorStatus, CorridorStatusValue, DepositFeeQuote, CreateDepositAddressOptions, ManagedDepositAddress, GetDepositAuthorizationParamsOptions, WatchDepositOptions, WatchedDepositAddress, RescanDepositOptions, DepositRescanEntry, DepositRescan, DefundAccountOptions, DefundAccountResponse, QuoteWithdrawalFeeOptions, WithdrawalFeeQuote, ListObjectsOptions, ListEventsOptions, ListOperationsOptions, GetOperationOptions, ExportOperationEvidenceOptions, EventConnectionStatus, EventCallback, EventEnvelope, RealmEvent, TypedRealmEvent, OperationCreatedEvent, OperationUpdatedEvent, EventCreatedEvent, ObjectCreatedEvent, ObjectUpdatedEvent, ObjectDeletedEvent, BalanceUpdatedEvent, ExchangeUpdatedEvent, FillPreviewedEvent, FillRecordedEvent, ExchangeFundingEvent, FundingPayment, AggregationUpdatedEvent, ObjectValuationEvent, FrameEvent, FrameAccount, MidsUpdatedEvent, CandleClosedEvent, CandleUpdatedEvent, OIUpdatedEvent, RealmCreatedEvent, PolicyEffect, PolicyStatement, TokenScope, MintTokenRequest, MintTokenResponse, ActionCatalogEntry, AliasCatalogEntry, PermissionCatalogResponse, ReservedBalance, ReservedBalanceStatus, ArcaPositionCurrent, RealmListResponse, CreatePerpsExchangeOptions, PredictedEffect, PlaceOrderOptions, ClosePositionOptions, SetPositionTriggerOptions, SetPositionTpslOptions, SetPositionTpslResult, OpenBracketOptions, OpenBracketResult, ClearPositionTpslOptions, CancelOrderOptions, ModifyOrderOptions, OrderOperationResponse, PlaceTwapOptions, TwapOperationResponse, Twap, TwapStatus, TwapLimits, OrderLimits, MinOrderSizeOptions, MinOrderSize, ValidateOrderSizeOptions, OrderSizeValidation, UpdateLeverageOptions, UpdateLeverageResponse, UpdateIsolatedMarginOptions, UpdateIsolatedMarginResponse, SetMarginModeOptions, SetMarginModeResponse, LeverageSetting, SimAccount, SimMarginSummary, OrderSide, PositionSide, OrderStatus, LeverageType, MarginMode, SimPosition, SimPositionId, PositionListResponse, OrderListResponse, SimOrder, SimFill, SimOrderWithFills, ExchangeIntent, ExchangeState, AccountingPendingExecution, Fill, FillDirection, FillResultingPosition, FillListResponse, ListFillsOptions, ListRealmFillsOptions, WatchRealmFillsOptions, OpenPositionCosts, MarketTradeSummary, TradeSummaryTotals, TradeSummaryResponse, TradeSummaryOptions, ActiveAssetData, AvailabilityBreakdown, CollateralModel, OrderBreakdownAmountType, OrderBreakdownOptions, OrderBreakdown, AssetFeeEntry, SimFeeRates, SimFeeTierEntry, Market, SimMetaResponse, SimMidsResponse, MarketTicker, MarketTickersResponse, SimBookLevel, SimBookResponse, CandleInterval, Candle, CandlesResponse, CandleEvent, OIBar, OIHistoryResponse, FundingObservation, FundingHistoryResponse, OIEvent, MarketTrade, TradeEvent, TradeExecutedEvent, LoadRangeResult, CandleChartUpdate, SparklinesResponse, InvariantViolation, InvariantCheckResult, InvariantCheckResponse, AuthAuditEventType, AuthAuditEntry, AuthAuditListResponse, AuthAuditFilters, CredentialScopeResponse, OrgRole, MemberType, InvitationStatus, Organization, OrgMember, OrgMemberListResponse, Invitation, InvitationListResponse, InvitationPreview, InviteMemberRequest, MyOrgMembership, CreateOrgResponse, UpdateMemberRequest, AgentEvent, AgentTextEvent, AgentToolUseEvent, AgentPlanEvent, AgentPlanStep, AgentConversationLogEvent, AgentDoneEvent, AgentStepUpdatedEvent, AgentExecutionDoneEvent, WatchSnapshot, WatchSnapshotBalanceEntry, WatchPathOptions, CustodyBoundaryStatus, CustodyExchangeArcaStatus, CustodyRealmHaltType, CustodyPendingExit, CustodyBoundary, CustodyExchangeArca, CustodyRealmHalt, CosignNonceState, CustodyImplRef, CustodyImplementations, CustodyStatus, CustodyBoundaryListResponse, CustodyExchangeArcaListResponse, RegisterRecoveryKeyOptions, RegisterRecoveryKeyResponse, PreparedCustodyTransaction, GeneratedRecoveryKey, ActiveTerms, CreateWatchBatchEntry, CreateWatchBatchItem, } from './types';
|
|
19
|
+
export type { TokenProvider, AuthErrorListener, ArcaConfig, ArcaApiKeyConfig, ArcaTokenConfig, ArcaObject, ArcaObjectType, ArcaObjectStatus, IsolationInfo, ArcaObjectListResponse, ArcaObjectBrowseResponse, BrowsePathEntry, BrowsePathKind, ArcaObjectDetailResponse, ArcaObjectVersionsResponse, IsolationZone, ArcaBalance, ArcaBalanceListResponse, EnsureArcaObjectResponse, DeleteArcaObjectResponse, Operation, OperationType, OperationState, OperationListResponse, OperationDetailResponse, OperationEvidence, OperationEvidenceJournal, OperationEvidenceIntegrity, OperationEvidenceExportResponse, JournalEntryEvidence, JournalLegEvidence, JournalProofEvidence, ChainTransactionEvidence, IntegrityAnnotation, ProofUniquenessEvidence, CryptographicSequenceState, OperationContext, FillContext, FeeBreakdown, TransferContext, DepositContext, WithdrawalContext, OrderPlacedContext, CancelContext, DeleteContext, ArcaEvent, EventListResponse, EventDetailResponse, StateDelta, DeltaType, StateDeltaListResponse, FundAccountResponse, TransferResponse, VenueHopProposal, VenueHopSubmission, CosignDomain, NonceResponse, ExplorerSummary, BatchSummariesResponse, CanonicalPosition, SnapshotBalancesResponse, AssetBreakdown, BalanceValue, PositionValue, ReservedValue, ObjectValuation, PathAggregation, RealmProjection, ProjectedValuation, ProjectedPnl, ProjectedVolume, ProjectionWindow, WindowedStatus, WindowedCoverage, ProjectionValuationsPage, GetProjectionValuationsOptions, ProjectionWatchScope, WatchProjectionOptions, PnlResponse, PnlHistoryResponse, PnlPoint, PnlChartBaseline, ExternalFlowEntry, EquityHistoryResponse, EquityPoint, AggregationSourceDto, CreateWatchResponse, WatchAggregationOptions, Watermark, ConsistentReadScope, ConsistentReadValue, ConsistentReadResult, ReconciliationState, ReconciliationStateListResponse, BuilderProfile, AuthResponse, RefreshResponse, ApiKeyStatus, ApiKey, ApiKeyPermissions, CreateApiKeyOptions, ApiKeyCreatedResponse, ApiKeyListResponse, BrowseObjectsOptions, CreateIsolationZoneOptions, ListIsolationZonesOptions, IsolationZoneListResponse, ArchiveIsolationZoneOptions, Realm, RealmSettings, RealmType, RealmAsset, RealmLifecycle, RealmBacking, CreateRealmAxes, EnsureDenominatedArcaOptions, EnsureArcaOptions, EnsureInfoOptions, UpdateLabelsOptions, FolderLabelsResponse, UpdateFolderLabelsRequest, PatchFolderLabelsRequest, EnsureDeletedOptions, TransferOptions, HopVenuesOptions, ProposeVenueHopOptions, SubmitVenueHopOptions, CosignDigestSigner, FundAccountOptions, QuoteDepositFeeOptions, CctpFeeQuote, CorridorStatus, CorridorStatusValue, DepositFeeQuote, CreateDepositAddressOptions, ManagedDepositAddress, GetDepositAuthorizationParamsOptions, WatchDepositOptions, WatchedDepositAddress, RescanDepositOptions, DepositRescanEntry, DepositRescan, DefundAccountOptions, DefundAccountResponse, QuoteWithdrawalFeeOptions, WithdrawalFeeQuote, ListObjectsOptions, ListEventsOptions, ListOperationsOptions, GetOperationOptions, ExportOperationEvidenceOptions, EventConnectionStatus, EventCallback, EventEnvelope, RealmEvent, TypedRealmEvent, OperationCreatedEvent, OperationUpdatedEvent, EventCreatedEvent, ObjectCreatedEvent, ObjectUpdatedEvent, ObjectDeletedEvent, BalanceUpdatedEvent, ExchangeUpdatedEvent, FillPreviewedEvent, FillRecordedEvent, ExchangeFundingEvent, FundingPayment, AggregationUpdatedEvent, ObjectValuationEvent, FrameEvent, FrameAccount, MidsUpdatedEvent, CandleClosedEvent, CandleUpdatedEvent, OIUpdatedEvent, RealmCreatedEvent, PolicyEffect, PolicyStatement, TokenScope, MintTokenRequest, MintTokenResponse, ActionCatalogEntry, AliasCatalogEntry, PermissionCatalogResponse, ReservedBalance, ReservedBalanceStatus, ArcaPositionCurrent, RealmListResponse, CreatePerpsExchangeOptions, PredictedEffect, PlaceOrderOptions, ClosePositionOptions, SetPositionTriggerOptions, SetPositionTpslOptions, SetPositionTpslResult, OpenBracketOptions, OpenBracketResult, ClearPositionTpslOptions, CancelOrderOptions, ModifyOrderOptions, OrderOperationResponse, PlaceTwapOptions, TwapOperationResponse, Twap, TwapStatus, TwapLimits, OrderLimits, MinOrderSizeOptions, MinOrderSize, ValidateOrderSizeOptions, OrderSizeValidation, UpdateLeverageOptions, UpdateLeverageResponse, UpdateIsolatedMarginOptions, UpdateIsolatedMarginResponse, SetMarginModeOptions, SetMarginModeResponse, LeverageSetting, SimAccount, SimMarginSummary, OrderSide, PositionSide, OrderStatus, LeverageType, MarginMode, SimPosition, SimPositionId, PositionListResponse, OrderListResponse, SimOrder, SimFill, SimOrderWithFills, ExchangeIntent, ExchangeState, AccountingPendingExecution, Fill, FillCloseReason, FillDirection, FillResultingPosition, FillListResponse, ListFillsOptions, ListRealmFillsOptions, WatchRealmFillsOptions, OpenPositionCosts, MarketTradeSummary, TradeSummaryTotals, TradeSummaryResponse, TradeSummaryOptions, ActiveAssetData, AvailabilityBreakdown, CollateralModel, OrderBreakdownAmountType, OrderBreakdownOptions, OrderBreakdown, AssetFeeEntry, SimFeeRates, SimFeeTierEntry, Market, SimMetaResponse, SimMidsResponse, MarketTicker, MarketTickersResponse, SimBookLevel, SimBookResponse, CandleInterval, Candle, CandlesResponse, CandleEvent, OIBar, OIHistoryResponse, FundingObservation, FundingHistoryResponse, OIEvent, MarketTrade, TradeEvent, TradeExecutedEvent, LoadRangeResult, CandleChartUpdate, SparklinesResponse, InvariantViolation, InvariantCheckResult, InvariantCheckResponse, AuthAuditEventType, AuthAuditEntry, AuthAuditListResponse, AuthAuditFilters, CredentialScopeResponse, OrgRole, MemberType, InvitationStatus, Organization, OrgMember, OrgMemberListResponse, Invitation, InvitationListResponse, InvitationPreview, InviteMemberRequest, MyOrgMembership, CreateOrgResponse, UpdateMemberRequest, AgentEvent, AgentTextEvent, AgentToolUseEvent, AgentPlanEvent, AgentPlanStep, AgentConversationLogEvent, AgentDoneEvent, AgentStepUpdatedEvent, AgentExecutionDoneEvent, WatchSnapshot, WatchSnapshotBalanceEntry, WatchPathOptions, CustodyBoundaryStatus, CustodyExchangeArcaStatus, CustodyRealmHaltType, CustodyPendingExit, CustodyBoundary, CustodyExchangeArca, CustodyRealmHalt, CosignNonceState, CustodyImplRef, CustodyImplementations, CustodyStatus, CustodyBoundaryListResponse, CustodyExchangeArcaListResponse, RegisterRecoveryKeyOptions, RegisterRecoveryKeyResponse, PreparedCustodyTransaction, GeneratedRecoveryKey, ActiveTerms, CreateWatchBatchEntry, CreateWatchBatchItem, } from './types';
|
|
20
20
|
export { EventType, Channel, toTypedEvent } from './types';
|
|
21
21
|
export type { CacheConfig } from './cache';
|
|
22
22
|
export { pickResolution, pickResolutionFromIso, bucketMs, retentionMs, alignDown, alignUp, boundaries, expectedPointCount, promotionTarget, ALL_RESOLUTIONS, DEFAULT_POINTS, MIN_POINTS, } from './ladder';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClG,OAAO,EAAE,0BAA0B,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClG,OAAO,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxI,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAClM,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AACjD,YAAY,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,sCAAsC,EAAE,MAAM,aAAa,CAAC;AACrE,YAAY,EACV,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAC9E,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AoB,GACrB,MAAM,UAAU,CAAC;AAClB,YAAY,EACV,eAAe,EACf,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAClG,YAAY,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACvF,YAAY,EAAE,eAAe,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAClI,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAErF,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.DEFAULT_POINTS = exports.ALL_RESOLUTIONS = exports.promotionTarget = exports.expectedPointCount = exports.boundaries = exports.alignUp = exports.alignDown = exports.retentionMs = exports.bucketMs = exports.pickResolutionFromIso = exports.pickResolution = exports.toTypedEvent = exports.Channel = exports.EventType = exports.availabilityDivergenceUsd = exports.getMarketAvailability = exports.WatchStreamReadyTimeoutError = exports.FundingWatchStream = exports.RealmExchangeWatchStream = exports.RealmFillWatchStream = exports.FillWatchStream = exports.TwapWatchStream = exports.TradeWatchStream = exports.ExchangeWatchStream = exports.CoverageTracker = exports.CandleChartStream = exports.OIWatchStream = exports.CandleWatchStream = exports.PriceWatchStream = exports.MaxOrderSizeWatchStream = exports.PnlChartStream = exports.EquityChartStream = exports.ProjectionWatchStream = exports.AggregationWatchStream = exports.ObjectsWatchStream = exports.ObjectWatchStream = exports.BalanceWatchStream = exports.OperationWatchStream = exports.OrderHandle = exports.OperationHandle = exports.WebSocketManager = exports.ArcaAdmin = exports.PROVIDER_EVIDENCE_PRIVY_IDENTITY_TOKEN = exports.computeChartRange = exports.Arca = exports.newAtlasAccountSalt = exports.
|
|
20
|
+
exports.DEFAULT_POINTS = exports.ALL_RESOLUTIONS = exports.promotionTarget = exports.expectedPointCount = exports.boundaries = exports.alignUp = exports.alignDown = exports.retentionMs = exports.bucketMs = exports.pickResolutionFromIso = exports.pickResolution = exports.toTypedEvent = exports.Channel = exports.EventType = exports.availabilityDivergenceUsd = exports.getMarketAvailability = exports.WatchStreamReadyTimeoutError = exports.FundingWatchStream = exports.RealmExchangeWatchStream = exports.RealmFillWatchStream = exports.FillWatchStream = exports.TwapWatchStream = exports.TradeWatchStream = exports.ExchangeWatchStream = exports.CoverageTracker = exports.CandleChartStream = exports.OIWatchStream = exports.CandleWatchStream = exports.PriceWatchStream = exports.MaxOrderSizeWatchStream = exports.PnlChartStream = exports.EquityChartStream = exports.ProjectionWatchStream = exports.AggregationWatchStream = exports.ObjectsWatchStream = exports.ObjectWatchStream = exports.BalanceWatchStream = exports.OperationWatchStream = exports.OrderHandle = exports.OperationHandle = exports.WebSocketManager = exports.ArcaAdmin = exports.PROVIDER_EVIDENCE_PRIVY_IDENTITY_TOKEN = exports.computeChartRange = exports.Arca = exports.newAtlasAccountSalt = exports.atlasHandshakeTypedData = exports.atlasOwnerActionTypedData = exports.atlasOwnerConsentTypedData = exports.createAtlasOwnerSigner = void 0;
|
|
21
21
|
exports.encodeP256Signature = exports.p256DeviceSigner = exports.p256DeviceKey = exports.verifierDeviceSigner = exports.addressDeviceSigner = exports.OPERATOR_ACTION_TYPEHASH_HEX = exports.verifyVenueHopProposal = exports.signTransferBetweenVenuesPreAuth = exports.signTransferBetweenVenues = exports.signDepositWithLien = exports.signRaiseLien = exports.signAccountApproveBuilderFee = exports.signRotateSovereignKey = exports.signAccountMigrateParent = exports.signAccountAddAgent = exports.signReassignAccountBoundary = exports.signVenueDepositPreAuth = exports.signAllocateToVenue = exports.signCrossTransfer = exports.signWithdraw = exports.transferBetweenVenuesParamsHash = exports.depositWithLienParamsHash = exports.raiseLienParamsHash = exports.accountApproveBuilderFeeParamsHash = exports.rotateSovereignKeyParamsHash = exports.accountMigrateParentParamsHash = exports.accountAddAgentParamsHash = exports.reassignAccountBoundaryParamsHash = exports.venueDepositPreAuthParamsHash = exports.allocateToVenueParamsHash = exports.crossTransferParamsHash = exports.cctpMintRecipient = exports.cctpWithdrawContext = exports.cctpWithdrawRouteRef = exports.cctpWithdrawRouteData = exports.CCTP_STANDARD_FINALITY = exports.CCTP_FAST_FINALITY = exports.CCTP_WITHDRAW_ROUTE_VERSION = exports.withdrawParamsHashV5 = exports.withdrawParamsHash = exports.recoverOperatorActionSigner = exports.signOperatorAction = exports.operatorActionDigest = exports.cosignDomainSeparator = exports.CosignActionV4 = exports.CosignAction = exports.RECOVERY_CLOSE_PX_BAND_BPS = exports.encodeRecoveryCloseOrder = exports.generateRecoveryKeyPair = exports.MIN_POINTS = void 0;
|
|
22
22
|
exports.rfc3339Micros = exports.observedBefore = exports.observationTime = exports.signedUnaccounted = exports.isAccountingSettled = exports.projectedPositions = exports.PositionUpdate = exports.PositionView = exports.CosignNonceUsedError = exports.CosignRequiredError = exports.StepUpCancelledError = exports.StepUpRequiredError = exports.OperationStalledError = exports.OperationFailedError = exports.ExchangeProvisioningError = exports.ExchangeError = exports.InternalError = exports.ConflictError = exports.NotFoundError = exports.ForbiddenError = exports.UnauthorizedError = exports.ValidationError = exports.ArcaError = exports.revalueProjectedValuation = exports.revalueExchangeState = exports.revalueAggregation = exports.revalueObject = exports.cosignVectors = exports.PERMIT_TYPEHASH_HEX = exports.BIND_BOUNDARY_TYPEHASH_HEX = exports.BIND_DESTINATION_TYPEHASH_HEX = exports.recoverPermitSigner = exports.recoverBindingSigner = exports.signPermit = exports.signBinding = exports.permitDigest = exports.bindingDigest = exports.permitTypedData = exports.bindingTypedData = exports.custodyKey = exports.recoverCosignerManageSigner = exports.signCosignerManage = exports.cosignerManageDigest = exports.cosignRegistryDomainSeparator = exports.CosignerManageAction = exports.encodeRegistryCosignBlob = exports.deviceSignerHash = void 0;
|
|
23
23
|
// Main SDK entry point
|
|
@@ -25,8 +25,8 @@ var atlas_wallet_1 = require("./atlas-wallet");
|
|
|
25
25
|
Object.defineProperty(exports, "createAtlasOwnerSigner", { enumerable: true, get: function () { return atlas_wallet_1.createAtlasOwnerSigner; } });
|
|
26
26
|
var atlas_ownership_1 = require("./atlas-ownership");
|
|
27
27
|
Object.defineProperty(exports, "atlasOwnerConsentTypedData", { enumerable: true, get: function () { return atlas_ownership_1.atlasOwnerConsentTypedData; } });
|
|
28
|
-
Object.defineProperty(exports, "
|
|
29
|
-
Object.defineProperty(exports, "
|
|
28
|
+
Object.defineProperty(exports, "atlasOwnerActionTypedData", { enumerable: true, get: function () { return atlas_ownership_1.atlasOwnerActionTypedData; } });
|
|
29
|
+
Object.defineProperty(exports, "atlasHandshakeTypedData", { enumerable: true, get: function () { return atlas_ownership_1.atlasHandshakeTypedData; } });
|
|
30
30
|
Object.defineProperty(exports, "newAtlasAccountSalt", { enumerable: true, get: function () { return atlas_ownership_1.newAtlasAccountSalt; } });
|
|
31
31
|
var arca_1 = require("./arca");
|
|
32
32
|
Object.defineProperty(exports, "Arca", { enumerable: true, get: function () { return arca_1.Arca; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,uBAAuB;AACvB,+CAAwD;AAA/C,sHAAA,sBAAsB,OAAA;AAE/B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,uBAAuB;AAC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EAA0E;AAAjE,qIAAA,OAAO,OAAiB;AAEjC,kBAAkB;AAClB,qCAA+G;AAAtG,wGAAA,aAAa,OAAA;AAAE,6GAAA,kBAAkB,OAAA;AAAE,+GAAA,oBAAoB,OAAA;AAAE,oHAAA,yBAAyB,OAAA;AAE3F,SAAS;AACT,mCAgBkB;AAfhB,mGAAA,SAAS,OAAA;AACT,yGAAA,eAAe,OAAA;AACf,2GAAA,iBAAiB,OAAA;AACjB,wGAAA,cAAc,OAAA;AACd,uGAAA,aAAa,OAAA;AACb,uGAAA,aAAa,OAAA;AACb,uGAAA,aAAa,OAAA;AACb,uGAAA,aAAa,OAAA;AACb,mHAAA,yBAAyB,OAAA;AACzB,8GAAA,oBAAoB,OAAA;AACpB,+GAAA,qBAAqB,OAAA;AACrB,6GAAA,mBAAmB,OAAA;AACnB,8GAAA,oBAAoB,OAAA;AACpB,6GAAA,mBAAmB,OAAA;AACnB,8GAAA,oBAAoB,OAAA;AAUtB,iDAA+D;AAAtD,6GAAA,YAAY,OAAA;AAAE,+GAAA,cAAc,OAAA;AACrC,2DAAkG;AAAzF,wHAAA,kBAAkB,OAAA;AAAE,yHAAA,mBAAmB,OAAA;AAAE,uHAAA,iBAAiB,OAAA;AAGnE,yDAAqF;AAA5E,oHAAA,eAAe,OAAA;AAAE,mHAAA,cAAc,OAAA;AAAE,kHAAA,aAAa,OAAA;AAEvD,2CAAyB;AACzB,0CAAwB"}
|
package/dist/money.d.ts
CHANGED
|
@@ -71,7 +71,10 @@ export interface MoneyFigure {
|
|
|
71
71
|
figure: MoneyFigureKind;
|
|
72
72
|
/** Arca's figure verbatim: Cash `confirmedMicro`, an account's `balances.totalMicro`, `totals.totalMicro`. */
|
|
73
73
|
settledMicro: string | null;
|
|
74
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* What the figure can pay out now: Cash `availableMicro`, an account's `withdrawableMicro` plus `spotMicro`;
|
|
76
|
+
* null for the total and for an account with no well-formed balances.
|
|
77
|
+
*/
|
|
75
78
|
availableMicro: string | null;
|
|
76
79
|
arriving: MoneyLeg[];
|
|
77
80
|
departing: MoneyLeg[];
|
package/dist/money.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"money.d.ts","sourceRoot":"","sources":["../src/money.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,uBAAuB,
|
|
1
|
+
{"version":3,"file":"money.d.ts","sourceRoot":"","sources":["../src/money.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,uBAAuB,EAAiC,wBAAwB,EAAE,uBAAuB,EAAiC,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEnM,0EAA0E;AAC1E,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,UAAU,CAAC;AAErD;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,YAAY,GAAG,UAAU,CAAC;AAEnE;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAClD;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GACtC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzC,4DAA4D;AAC5D,MAAM,WAAW,QAAQ;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,cAAc,CAAC;IAC1B,KAAK,EAAE,aAAa,CAAC;IACrB,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,iBAAiB,CAAC;IAChC,iFAAiF;IACjF,SAAS,EAAE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0F;AAC1F,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,GAAG;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAM5H;AAED,gDAAgD;AAChD,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,EAAE,CAEtE;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,uBAAuB,EAAE,QAAQ,EAAE,uBAAuB,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAIrI;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,uBAAuB,EAAE,OAAO,GAAE,yBAA8B,GAAG,WAAW,CAsF1H;AA8KD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIrD;AAED,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAIjD;AAED,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAInE;AAED,qHAAqH;AACrH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAO3D"}
|
package/dist/money.js
CHANGED
|
@@ -73,7 +73,7 @@ function composeWalletMoney(snapshot, options = {}) {
|
|
|
73
73
|
let figure = {
|
|
74
74
|
figure: { kind: 'account', arcaId: account.arcaId },
|
|
75
75
|
settledMicro: account.balances?.totalMicro ?? null,
|
|
76
|
-
availableMicro: account.balances
|
|
76
|
+
availableMicro: account.balances ? accountPayout(account.balances) : null,
|
|
77
77
|
arriving: ends.arriving,
|
|
78
78
|
departing: ends.departing,
|
|
79
79
|
asOf: account.asOf,
|
|
@@ -247,6 +247,18 @@ function revalue(revaluation, account, figure) {
|
|
|
247
247
|
return { ok: false, reason: 'venue frame older than the figure' };
|
|
248
248
|
return { ok: true, micro: revaluation.equityMicro };
|
|
249
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* What an account can pay out now: the venue's perps withdrawable plus its free spot USDC, two parts of the
|
|
252
|
+
* one observation the frame carries, counted as Arca's route previews count them. Under Hyperliquid's unified
|
|
253
|
+
* and portfolio-margin modes withdrawable is 0 and free spot is all of it. Null unless both are non-negative
|
|
254
|
+
* integers.
|
|
255
|
+
*/
|
|
256
|
+
function accountPayout(balances) {
|
|
257
|
+
const withdrawable = microParse(balances.withdrawableMicro), spot = microParse(balances.spotMicro);
|
|
258
|
+
if (withdrawable === null || spot === null || withdrawable < 0n || spot < 0n)
|
|
259
|
+
return null;
|
|
260
|
+
return (withdrawable + spot).toString();
|
|
261
|
+
}
|
|
250
262
|
/** `cash.confirmed + moving(in transit) + Σ accounts`, for the diagnostic only. */
|
|
251
263
|
function composedTotal(snapshot) {
|
|
252
264
|
const terms = [snapshot.cash.balances.confirmedMicro];
|