passkey-kit 0.9.4 → 0.10.1
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/.vscode/settings.json +0 -4
- package/PROPOSAL.md +4 -4
- package/README.md +1 -1
- package/cheatsheet.txt +2 -2
- package/package.json +8 -8
- package/packages/passkey-factory-sdk/package.json +2 -2
- package/packages/passkey-factory-sdk/src/index.ts +4 -6
- package/packages/passkey-factory-sdk/types/index.d.ts +7 -7
- package/packages/passkey-kit-sdk/package.json +2 -2
- package/packages/passkey-kit-sdk/src/index.ts +54 -30
- package/packages/passkey-kit-sdk/types/index.d.ts +46 -20
- package/packages/sac-sdk/package.json +2 -2
- package/packages/sac-sdk/src/index.ts +20 -22
- package/packages/sac-sdk/types/index.d.ts +12 -12
- package/src/index.ts +1 -1
- package/src/kit.ts +64 -36
- package/src/server.ts +24 -16
- package/src/types.ts +10 -0
- package/types/index.d.ts +1 -1
- package/types/kit.d.ts +11 -5
- package/types/server.d.ts +7 -9
- package/types/types.d.ts +9 -0
package/.vscode/settings.json
CHANGED
|
@@ -2,9 +2,5 @@
|
|
|
2
2
|
"rust-analyzer.linkedProjects": [
|
|
3
3
|
"./zephyr/Cargo.toml",
|
|
4
4
|
"./contracts/Cargo.toml",
|
|
5
|
-
"./contracts/example-contract/Cargo.toml",
|
|
6
|
-
"./contracts/sample-policy/Cargo.toml",
|
|
7
|
-
"./contracts/webauthn-factory/Cargo.toml",
|
|
8
|
-
"./contracts/webauthn-wallet/Cargo.toml",
|
|
9
5
|
]
|
|
10
6
|
}
|
package/PROPOSAL.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Smart wallet contract interface
|
|
2
2
|
|
|
3
3
|
With the release of [Protocol 21](https://stellar.org/blog/developers/announcing-protocol-21) (and specifically the inclusion of the secp256r1 verification curve) Soroban now has tremendous first class support for passkey powered smart wallets.
|
|
4
4
|
|
|
@@ -38,7 +38,7 @@ enum Error {
|
|
|
38
38
|
|
|
39
39
|
## Code
|
|
40
40
|
|
|
41
|
-
[https://github.com/kalepail/passkey-kit/blob/main/contracts/
|
|
41
|
+
[https://github.com/kalepail/passkey-kit/blob/main/contracts/smart-wallet-factory/src/lib.rs](https://github.com/kalepail/passkey-kit/blob/main/contracts/smart-wallet-factory/src/lib.rs)
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
@@ -155,7 +155,7 @@ enum Error {
|
|
|
155
155
|
|
|
156
156
|
## Code
|
|
157
157
|
|
|
158
|
-
[https://github.com/kalepail/passkey-kit/blob/main/contracts/
|
|
158
|
+
[https://github.com/kalepail/passkey-kit/blob/main/contracts/smart-wallet/src/lib.rs](https://github.com/kalepail/passkey-kit/blob/main/contracts/smart-wallet/src/lib.rs)
|
|
159
159
|
|
|
160
160
|
### `add`
|
|
161
161
|
```rust
|
|
@@ -371,7 +371,7 @@ This is the beefy boy and most of it is only interesting to auditors ensuring th
|
|
|
371
371
|
This is a relatively straight forward check. If the request is for the smart wallet contract ensure the only function it *might* be able to call is a `remove` of it’s own `id`. Anything else should result in an error.
|
|
372
372
|
|
|
373
373
|
|
|
374
|
-
The rest of `__check_auth` is boilerplate authentication checks of the
|
|
374
|
+
The rest of `__check_auth` is boilerplate authentication checks of the signature data itself and not technically part of this interface. It needs to be audited but that won’t affect the final interface of the wallet.
|
|
375
375
|
|
|
376
376
|
# Events
|
|
377
377
|
|
package/README.md
CHANGED
|
@@ -100,7 +100,7 @@ pnpm run start
|
|
|
100
100
|
```
|
|
101
101
|
|
|
102
102
|
> [!IMPORTANT]
|
|
103
|
-
> If you fiddle with contracts in `./contracts` you'll need to run the make commands. Just remember to update the `
|
|
103
|
+
> If you fiddle with contracts in `./contracts` you'll need to run the make commands. Just remember to update the `SMART_WALLET_FACTORY` and `SMART_WALLET_WASM` values from the `make deploy` command before running `make init`.
|
|
104
104
|
|
|
105
105
|
> [!IMPORTANT]
|
|
106
106
|
> Keep in mind the bindings here in `./packages` have been _heavily_ modified. Be careful when rebuilding and updating. Likely you'll only want to update the `src/index.ts` files in each respective package vs swapping out entire directories.
|
package/cheatsheet.txt
CHANGED
|
@@ -5,7 +5,7 @@ npm publish --workspaces
|
|
|
5
5
|
pnpm publish --no-git-checks
|
|
6
6
|
|
|
7
7
|
# Stellar commands
|
|
8
|
-
stellar contract bindings rust --wasm target/wasm32-unknown-unknown/release/
|
|
8
|
+
stellar contract bindings rust --wasm target/wasm32-unknown-unknown/release/smart_wallet.wasm
|
|
9
9
|
stellar contract deploy --wasm target/wasm32-unknown-unknown/release/sample_policy.wasm --network testnet --source default
|
|
10
10
|
|
|
11
11
|
# Mercury commands
|
|
@@ -13,6 +13,6 @@ stellar contract deploy --wasm target/wasm32-unknown-unknown/release/sample_poli
|
|
|
13
13
|
|
|
14
14
|
export JWT=???
|
|
15
15
|
mercury-cli --jwt $JWT --local false --mainnet false deploy
|
|
16
|
-
mercury-cli --jwt $JWT --local false --mainnet false catchup --project-name "smart-wallets-
|
|
16
|
+
mercury-cli --jwt $JWT --local false --mainnet false catchup --project-name "smart-wallets-next-dima" --contracts CAO555SGDJ4TA3CYZ6TRVACQG5O6ROY24PSQZULVGRSJ2A772CFDVGV7
|
|
17
17
|
curl -X GET https://api.mercurydata.app/catchups/4
|
|
18
18
|
curl -X POST https://api.mercurydata.app/v2/key -H "Authorization: Bearer $JWT"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "passkey-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "A helper library for creating and using smart wallet accounts on the Stellar blockchain.",
|
|
5
5
|
"author": "Tyler van der Hoeven",
|
|
6
6
|
"license": "MIT",
|
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
"main": "src/index.ts",
|
|
9
9
|
"types": "types/index.d.ts",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@simplewebauthn/browser": "^
|
|
11
|
+
"@simplewebauthn/browser": "^11.0.0",
|
|
12
12
|
"@stellar/stellar-sdk": "13.0.0-beta.1",
|
|
13
13
|
"base64url": "^3.0.1",
|
|
14
14
|
"buffer": "^6.0.3",
|
|
15
|
-
"passkey-factory-sdk": "0.
|
|
16
|
-
"passkey-kit-sdk": "0.
|
|
17
|
-
"sac-sdk": "0.
|
|
15
|
+
"passkey-factory-sdk": "0.6.0",
|
|
16
|
+
"passkey-kit-sdk": "0.6.0",
|
|
17
|
+
"sac-sdk": "0.3.0"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@simplewebauthn/types": "^
|
|
21
|
-
"@types/node": "^22.7.
|
|
22
|
-
"typescript": "^5.6.
|
|
20
|
+
"@simplewebauthn/types": "^11.0.0",
|
|
21
|
+
"@types/node": "^22.7.5",
|
|
22
|
+
"typescript": "^5.6.3"
|
|
23
23
|
},
|
|
24
24
|
"workspaces": [
|
|
25
25
|
"packages/*"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.6.0",
|
|
3
3
|
"name": "passkey-factory-sdk",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/index.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"buffer": "6.0.3",
|
|
13
|
-
"@stellar/stellar-sdk": "
|
|
13
|
+
"@stellar/stellar-sdk": "13.0.0-beta.1"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"typescript": "5.6.2"
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Buffer } from "buffer";
|
|
2
|
-
import { Address } from '@stellar/stellar-sdk/minimal';
|
|
3
2
|
import {
|
|
4
3
|
AssembledTransaction,
|
|
5
4
|
Client as ContractClient,
|
|
6
5
|
ClientOptions as ContractClientOptions,
|
|
7
6
|
Result,
|
|
8
7
|
Spec as ContractSpec,
|
|
9
|
-
} from '@stellar/stellar-sdk/contract';
|
|
8
|
+
} from '@stellar/stellar-sdk/minimal/contract';
|
|
10
9
|
import type {
|
|
11
10
|
u32,
|
|
12
11
|
i32,
|
|
@@ -19,14 +18,13 @@ import type {
|
|
|
19
18
|
Option,
|
|
20
19
|
Typepoint,
|
|
21
20
|
Duration,
|
|
22
|
-
} from '@stellar/stellar-sdk/contract';
|
|
21
|
+
} from '@stellar/stellar-sdk/minimal/contract';
|
|
23
22
|
|
|
24
23
|
if (typeof window !== 'undefined') {
|
|
25
24
|
//@ts-ignore Buffer exists
|
|
26
25
|
window.Buffer = window.Buffer || Buffer;
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
|
|
30
28
|
export const networks = {
|
|
31
29
|
testnet: {
|
|
32
30
|
networkPassphrase: "Test SDF Network ; September 2015",
|
|
@@ -39,7 +37,7 @@ export type SignerKey = { tag: "Policy", values: readonly [string] } | { tag: "E
|
|
|
39
37
|
export type SignerLimits = readonly [Map<string, Option<Array<SignerKey>>>];
|
|
40
38
|
export type SignerStorage = { tag: "Persistent", values: void } | { tag: "Temporary", values: void };
|
|
41
39
|
|
|
42
|
-
export type Signer = { tag: "Policy", values: readonly [string, SignerLimits, SignerStorage] } | { tag: "Ed25519", values: readonly [Buffer, SignerLimits, SignerStorage] } | { tag: "Secp256r1", values: readonly [Buffer, Buffer, SignerLimits, SignerStorage] };
|
|
40
|
+
export type Signer = { tag: "Policy", values: readonly [string, Option<u32>, SignerLimits, SignerStorage] } | { tag: "Ed25519", values: readonly [Buffer, Option<u32>, SignerLimits, SignerStorage] } | { tag: "Secp256r1", values: readonly [Buffer, Buffer, Option<u32>, SignerLimits, SignerStorage] };
|
|
43
41
|
|
|
44
42
|
export const Errors = {
|
|
45
43
|
1: { message: "NotInitialized" },
|
|
@@ -95,7 +93,7 @@ export class Client extends ContractClient {
|
|
|
95
93
|
new ContractSpec(["AAAAAgAAAAAAAAAAAAAACVNpZ25lcktleQAAAAAAAAMAAAABAAA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x0AAAD7gAAACAAAAAAAAAABnNpZ25lcgAAAAAH0AAAAAZTaWduZXIAAAAAAAEAAAPpAAAAEwAAAAM="]),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Buffer } from "buffer";
|
|
2
|
-
import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions, Result } from '@stellar/stellar-sdk/contract';
|
|
3
|
-
import type { Option } from '@stellar/stellar-sdk/contract';
|
|
2
|
+
import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions, Result } from '@stellar/stellar-sdk/minimal/contract';
|
|
3
|
+
import type { u32, Option } from '@stellar/stellar-sdk/minimal/contract';
|
|
4
4
|
export declare const networks: {
|
|
5
5
|
readonly testnet: {
|
|
6
6
|
readonly networkPassphrase: "Test SDF Network ; September 2015";
|
|
@@ -27,13 +27,13 @@ export type SignerStorage = {
|
|
|
27
27
|
};
|
|
28
28
|
export type Signer = {
|
|
29
29
|
tag: "Policy";
|
|
30
|
-
values: readonly [string, SignerLimits, SignerStorage];
|
|
30
|
+
values: readonly [string, Option<u32>, SignerLimits, SignerStorage];
|
|
31
31
|
} | {
|
|
32
32
|
tag: "Ed25519";
|
|
33
|
-
values: readonly [Buffer, SignerLimits, SignerStorage];
|
|
33
|
+
values: readonly [Buffer, Option<u32>, SignerLimits, SignerStorage];
|
|
34
34
|
} | {
|
|
35
35
|
tag: "Secp256r1";
|
|
36
|
-
values: readonly [Buffer, Buffer, SignerLimits, SignerStorage];
|
|
36
|
+
values: readonly [Buffer, Buffer, Option<u32>, SignerLimits, SignerStorage];
|
|
37
37
|
};
|
|
38
38
|
export declare const Errors: {
|
|
39
39
|
1: {
|
|
@@ -88,7 +88,7 @@ export declare class Client extends ContractClient {
|
|
|
88
88
|
readonly options: ContractClientOptions;
|
|
89
89
|
constructor(options: ContractClientOptions);
|
|
90
90
|
readonly fromJSON: {
|
|
91
|
-
init: (json: string) => AssembledTransaction<Result<void, import("@stellar/stellar-sdk/contract").ErrorMessage>>;
|
|
92
|
-
deploy: (json: string) => AssembledTransaction<Result<string, import("@stellar/stellar-sdk/contract").ErrorMessage>>;
|
|
91
|
+
init: (json: string) => AssembledTransaction<Result<void, import("@stellar/stellar-sdk/minimal/contract").ErrorMessage>>;
|
|
92
|
+
deploy: (json: string) => AssembledTransaction<Result<string, import("@stellar/stellar-sdk/minimal/contract").ErrorMessage>>;
|
|
93
93
|
};
|
|
94
94
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.6.0",
|
|
3
3
|
"name": "passkey-kit-sdk",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/index.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"buffer": "6.0.3",
|
|
13
|
-
"@stellar/stellar-sdk": "
|
|
13
|
+
"@stellar/stellar-sdk": "13.0.0-beta.1"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"typescript": "5.6.2"
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Buffer } from "buffer";
|
|
2
|
-
import { Address } from '@stellar/stellar-sdk/minimal';
|
|
3
2
|
import {
|
|
4
3
|
AssembledTransaction,
|
|
5
4
|
Client as ContractClient,
|
|
6
5
|
ClientOptions as ContractClientOptions,
|
|
7
6
|
Result,
|
|
8
7
|
Spec as ContractSpec,
|
|
9
|
-
} from '@stellar/stellar-sdk/contract';
|
|
8
|
+
} from '@stellar/stellar-sdk/minimal/contract';
|
|
10
9
|
import type {
|
|
11
10
|
u32,
|
|
12
11
|
i32,
|
|
@@ -19,14 +18,13 @@ import type {
|
|
|
19
18
|
Option,
|
|
20
19
|
Typepoint,
|
|
21
20
|
Duration,
|
|
22
|
-
} from '@stellar/stellar-sdk/contract';
|
|
21
|
+
} from '@stellar/stellar-sdk/minimal/contract';
|
|
23
22
|
|
|
24
23
|
if (typeof window !== 'undefined') {
|
|
25
24
|
//@ts-ignore Buffer exists
|
|
26
25
|
window.Buffer = window.Buffer || Buffer;
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
|
|
30
28
|
export const networks = {
|
|
31
29
|
testnet: {
|
|
32
30
|
networkPassphrase: "Test SDF Network ; September 2015",
|
|
@@ -37,26 +35,30 @@ export const networks = {
|
|
|
37
35
|
export const Errors = {
|
|
38
36
|
1: { message: "NotFound" },
|
|
39
37
|
|
|
40
|
-
2: { message: "
|
|
38
|
+
2: { message: "AlreadyExists" },
|
|
39
|
+
|
|
40
|
+
3: { message: "MissingContext" },
|
|
41
|
+
|
|
42
|
+
4: { message: "SignerExpired" },
|
|
41
43
|
|
|
42
|
-
|
|
44
|
+
5: { message: "FailedSignerLimits" },
|
|
43
45
|
|
|
44
|
-
|
|
46
|
+
6: { message: "FailedPolicySignerLimits" },
|
|
45
47
|
|
|
46
|
-
|
|
48
|
+
7: { message: "SignatureKeyValueMismatch" },
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
8: { message: "ClientDataJsonChallengeIncorrect" },
|
|
49
51
|
|
|
50
|
-
|
|
52
|
+
9: { message: "JsonParseError" }
|
|
51
53
|
}
|
|
52
54
|
export type SignerLimits = readonly [Map<string, Option<Array<SignerKey>>>];
|
|
53
55
|
export type SignerKey = { tag: "Policy", values: readonly [string] } | { tag: "Ed25519", values: readonly [Buffer] } | { tag: "Secp256r1", values: readonly [Buffer] };
|
|
54
56
|
|
|
55
|
-
export type SignerVal = { tag: "Policy", values: readonly [SignerLimits] } | { tag: "Ed25519", values: readonly [SignerLimits] } | { tag: "Secp256r1", values: readonly [Buffer, SignerLimits] };
|
|
57
|
+
export type SignerVal = { tag: "Policy", values: readonly [Option<u32>, SignerLimits] } | { tag: "Ed25519", values: readonly [Option<u32>, SignerLimits] } | { tag: "Secp256r1", values: readonly [Buffer, Option<u32>, SignerLimits] };
|
|
56
58
|
|
|
57
59
|
export type SignerStorage = { tag: "Persistent", values: void } | { tag: "Temporary", values: void };
|
|
58
60
|
|
|
59
|
-
export type Signer = { tag: "Policy", values: readonly [string, SignerLimits, SignerStorage] } | { tag: "Ed25519", values: readonly [Buffer, SignerLimits, SignerStorage] } | { tag: "Secp256r1", values: readonly [Buffer, Buffer, SignerLimits, SignerStorage] };
|
|
61
|
+
export type Signer = { tag: "Policy", values: readonly [string, Option<u32>, SignerLimits, SignerStorage] } | { tag: "Ed25519", values: readonly [Buffer, Option<u32>, SignerLimits, SignerStorage] } | { tag: "Secp256r1", values: readonly [Buffer, Buffer, Option<u32>, SignerLimits, SignerStorage] };
|
|
60
62
|
|
|
61
63
|
|
|
62
64
|
export interface Secp256r1Signature {
|
|
@@ -71,9 +73,29 @@ export type Signatures = readonly [Map<SignerKey, Option<Signature>>];
|
|
|
71
73
|
|
|
72
74
|
export interface Client {
|
|
73
75
|
/**
|
|
74
|
-
* Construct and simulate a
|
|
76
|
+
* Construct and simulate a add_signer transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
77
|
+
*/
|
|
78
|
+
add_signer: ({ signer }: { signer: Signer }, options?: {
|
|
79
|
+
/**
|
|
80
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
81
|
+
*/
|
|
82
|
+
fee?: number;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
86
|
+
*/
|
|
87
|
+
timeoutInSeconds?: number;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
91
|
+
*/
|
|
92
|
+
simulate?: boolean;
|
|
93
|
+
}) => Promise<AssembledTransaction<null>>
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Construct and simulate a update_signer transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
75
97
|
*/
|
|
76
|
-
|
|
98
|
+
update_signer: ({ signer }: { signer: Signer }, options?: {
|
|
77
99
|
/**
|
|
78
100
|
* The fee to pay for the transaction. Default: BASE_FEE
|
|
79
101
|
*/
|
|
@@ -88,12 +110,12 @@ export interface Client {
|
|
|
88
110
|
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
89
111
|
*/
|
|
90
112
|
simulate?: boolean;
|
|
91
|
-
}) => Promise<AssembledTransaction<
|
|
113
|
+
}) => Promise<AssembledTransaction<null>>
|
|
92
114
|
|
|
93
115
|
/**
|
|
94
|
-
* Construct and simulate a
|
|
116
|
+
* Construct and simulate a remove_signer transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
95
117
|
*/
|
|
96
|
-
|
|
118
|
+
remove_signer: ({ signer_key }: { signer_key: SignerKey }, options?: {
|
|
97
119
|
/**
|
|
98
120
|
* The fee to pay for the transaction. Default: BASE_FEE
|
|
99
121
|
*/
|
|
@@ -108,12 +130,12 @@ export interface Client {
|
|
|
108
130
|
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
109
131
|
*/
|
|
110
132
|
simulate?: boolean;
|
|
111
|
-
}) => Promise<AssembledTransaction<
|
|
133
|
+
}) => Promise<AssembledTransaction<null>>
|
|
112
134
|
|
|
113
135
|
/**
|
|
114
|
-
* Construct and simulate a
|
|
136
|
+
* Construct and simulate a update_contract_code transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
115
137
|
*/
|
|
116
|
-
|
|
138
|
+
update_contract_code: ({ hash }: { hash: Buffer }, options?: {
|
|
117
139
|
/**
|
|
118
140
|
* The fee to pay for the transaction. Default: BASE_FEE
|
|
119
141
|
*/
|
|
@@ -128,31 +150,33 @@ export interface Client {
|
|
|
128
150
|
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
129
151
|
*/
|
|
130
152
|
simulate?: boolean;
|
|
131
|
-
}) => Promise<AssembledTransaction<
|
|
153
|
+
}) => Promise<AssembledTransaction<null>>
|
|
132
154
|
|
|
133
155
|
}
|
|
134
156
|
export class Client extends ContractClient {
|
|
135
157
|
constructor(public readonly options: ContractClientOptions) {
|
|
136
158
|
super(
|
|
137
|
-
new ContractSpec(["
|
|
159
|
+
new ContractSpec(["AAAABAAAAAAAAAAAAAAABUVycm9yAAAAAAAACQAAAAAAAAAITm90Rm91bmQAAAABAAAAAAAAAA1BbHJlYWR5RXhpc3RzAAAAAAAAAgAAAAAAAAAOTWlzc2luZ0NvbnRleHQAAAAAAAMAAAAAAAAADVNpZ25lckV4cGlyZWQAAAAAAAAEAAAAAAAAABJGYWlsZWRTaWduZXJMaW1pdHMAAAAAAAUAAAAAAAAAGEZhaWxlZFBvbGljeVNpZ25lckxpbWl0cwAAAAYAAAAAAAAAGVNpZ25hdHVyZUtleVZhbHVlTWlzbWF0Y2gAAAAAAAAHAAAAAAAAACBDbGllbnREYXRhSnNvbkNoYWxsZW5nZUluY29ycmVjdAAAAAgAAAAAAAAADkpzb25QYXJzZUVycm9yAAAAAAAJ",
|
|
138
160
|
"AAAAAQAAAAAAAAAAAAAADFNpZ25lckxpbWl0cwAAAAEAAAAAAAAAATAAAAAAAAPsAAAAEwAAA+gAAAPqAAAH0AAAAAlTaWduZXJLZXkAAAA=",
|
|
139
161
|
"AAAAAgAAAAAAAAAAAAAACVNpZ25lcktleQAAAAAAAAMAAAABAAAAAAAAAAZQb2xpY3kAAAAAAAEAAAATAAAAAQAAAAAAAAAHRWQyNTUxOQAAAAABAAAD7gAAACAAAAABAAAAAAAAAAlTZWNwMjU2cjEAAAAAAAABAAAADg==",
|
|
140
|
-
"
|
|
162
|
+
"AAAAAgAAAAAAAAAAAAAACVNpZ25lclZhbAAAAAAAAAMAAAABAAAAAAAAAAZQb2xpY3kAAAAAAAIAAAPoAAAABAAA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hdHVyZQAA",
|
|
145
167
|
"AAAAAQAAAAAAAAAAAAAAClNpZ25hdHVyZXMAAAAAAAEAAAAAAAAAATAAAAAAAAPsAAAH0AAAAAlTaWduZXJLZXkAAAAAAAPoAAAH0AAAAAlTaWduYXR1cmUAAAA=",
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
"
|
|
168
|
+
"AAAAAAAAAAAAAAAKYWRkX3NpZ25lcgAAAAAAAQAAAAAAAAAGc2lnbmVyAAAAAAfQAAAABlNpZ25lcgAAAAAAAA==",
|
|
169
|
+
"AAAAAAAAAAAAAAANdXBkYXRlX3NpZ25lcgAAAAAAAAEAAAAAAAAABnNpZ25lcgAAAAAH0AAAAAZTaWduZXIAAAAAAAA=",
|
|
170
|
+
"AAAAAAAAAAAAAAANcmVtb3ZlX3NpZ25lcgAAAAAAAAEAAAAAAAAACnNpZ25lcl9rZXkAAAAAB9AAAAAJU2lnbmVyS2V5AAAAAAAAAA==",
|
|
171
|
+
"AAAAAAAAAAAAAAAUdXBkYXRlX2NvbnRyYWN0X2NvZGUAAAABAAAAAAAAAARoYXNoAAAD7gAAACAAAAAA",
|
|
149
172
|
"AAAAAAAAAAAAAAAMX19jaGVja19hdXRoAAAAAwAAAAAAAAARc2lnbmF0dXJlX3BheWxvYWQAAAAAAAPuAAAAIAAAAAAAAAAKc2lnbmF0dXJlcwAAAAAH0AAAAApTaWduYXR1cmVzAAAAAAAAAAAADWF1dGhfY29udGV4dHMAAAAAAAPqAAAH0AAAAAdDb250ZXh0AAAAAAEAAAPpAAAD7QAAAAAAAAAD"]),
|
|
150
173
|
options
|
|
151
174
|
)
|
|
152
175
|
}
|
|
153
176
|
public readonly fromJSON = {
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
177
|
+
add_signer: this.txFromJSON<null>,
|
|
178
|
+
update_signer: this.txFromJSON<null>,
|
|
179
|
+
remove_signer: this.txFromJSON<null>,
|
|
180
|
+
update_contract_code: this.txFromJSON<null>
|
|
157
181
|
}
|
|
158
182
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Buffer } from "buffer";
|
|
2
|
-
import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions
|
|
3
|
-
import type { Option } from '@stellar/stellar-sdk/contract';
|
|
2
|
+
import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions } from '@stellar/stellar-sdk/minimal/contract';
|
|
3
|
+
import type { u32, Option } from '@stellar/stellar-sdk/minimal/contract';
|
|
4
4
|
export declare const networks: {
|
|
5
5
|
readonly testnet: {
|
|
6
6
|
readonly networkPassphrase: "Test SDF Network ; September 2015";
|
|
@@ -29,6 +29,12 @@ export declare const Errors: {
|
|
|
29
29
|
7: {
|
|
30
30
|
message: string;
|
|
31
31
|
};
|
|
32
|
+
8: {
|
|
33
|
+
message: string;
|
|
34
|
+
};
|
|
35
|
+
9: {
|
|
36
|
+
message: string;
|
|
37
|
+
};
|
|
32
38
|
};
|
|
33
39
|
export type SignerLimits = readonly [Map<string, Option<Array<SignerKey>>>];
|
|
34
40
|
export type SignerKey = {
|
|
@@ -43,13 +49,13 @@ export type SignerKey = {
|
|
|
43
49
|
};
|
|
44
50
|
export type SignerVal = {
|
|
45
51
|
tag: "Policy";
|
|
46
|
-
values: readonly [SignerLimits];
|
|
52
|
+
values: readonly [Option<u32>, SignerLimits];
|
|
47
53
|
} | {
|
|
48
54
|
tag: "Ed25519";
|
|
49
|
-
values: readonly [SignerLimits];
|
|
55
|
+
values: readonly [Option<u32>, SignerLimits];
|
|
50
56
|
} | {
|
|
51
57
|
tag: "Secp256r1";
|
|
52
|
-
values: readonly [Buffer, SignerLimits];
|
|
58
|
+
values: readonly [Buffer, Option<u32>, SignerLimits];
|
|
53
59
|
};
|
|
54
60
|
export type SignerStorage = {
|
|
55
61
|
tag: "Persistent";
|
|
@@ -60,13 +66,13 @@ export type SignerStorage = {
|
|
|
60
66
|
};
|
|
61
67
|
export type Signer = {
|
|
62
68
|
tag: "Policy";
|
|
63
|
-
values: readonly [string, SignerLimits, SignerStorage];
|
|
69
|
+
values: readonly [string, Option<u32>, SignerLimits, SignerStorage];
|
|
64
70
|
} | {
|
|
65
71
|
tag: "Ed25519";
|
|
66
|
-
values: readonly [Buffer, SignerLimits, SignerStorage];
|
|
72
|
+
values: readonly [Buffer, Option<u32>, SignerLimits, SignerStorage];
|
|
67
73
|
} | {
|
|
68
74
|
tag: "Secp256r1";
|
|
69
|
-
values: readonly [Buffer, Buffer, SignerLimits, SignerStorage];
|
|
75
|
+
values: readonly [Buffer, Buffer, Option<u32>, SignerLimits, SignerStorage];
|
|
70
76
|
};
|
|
71
77
|
export interface Secp256r1Signature {
|
|
72
78
|
authenticator_data: Buffer;
|
|
@@ -83,9 +89,28 @@ export type Signature = {
|
|
|
83
89
|
export type Signatures = readonly [Map<SignerKey, Option<Signature>>];
|
|
84
90
|
export interface Client {
|
|
85
91
|
/**
|
|
86
|
-
* Construct and simulate a
|
|
92
|
+
* Construct and simulate a add_signer transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
93
|
+
*/
|
|
94
|
+
add_signer: ({ signer }: {
|
|
95
|
+
signer: Signer;
|
|
96
|
+
}, options?: {
|
|
97
|
+
/**
|
|
98
|
+
* The fee to pay for the transaction. Default: BASE_FEE
|
|
99
|
+
*/
|
|
100
|
+
fee?: number;
|
|
101
|
+
/**
|
|
102
|
+
* The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
|
|
103
|
+
*/
|
|
104
|
+
timeoutInSeconds?: number;
|
|
105
|
+
/**
|
|
106
|
+
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
107
|
+
*/
|
|
108
|
+
simulate?: boolean;
|
|
109
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
110
|
+
/**
|
|
111
|
+
* Construct and simulate a update_signer transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
87
112
|
*/
|
|
88
|
-
|
|
113
|
+
update_signer: ({ signer }: {
|
|
89
114
|
signer: Signer;
|
|
90
115
|
}, options?: {
|
|
91
116
|
/**
|
|
@@ -100,11 +125,11 @@ export interface Client {
|
|
|
100
125
|
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
101
126
|
*/
|
|
102
127
|
simulate?: boolean;
|
|
103
|
-
}) => Promise<AssembledTransaction<
|
|
128
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
104
129
|
/**
|
|
105
|
-
* Construct and simulate a
|
|
130
|
+
* Construct and simulate a remove_signer transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
106
131
|
*/
|
|
107
|
-
|
|
132
|
+
remove_signer: ({ signer_key }: {
|
|
108
133
|
signer_key: SignerKey;
|
|
109
134
|
}, options?: {
|
|
110
135
|
/**
|
|
@@ -119,11 +144,11 @@ export interface Client {
|
|
|
119
144
|
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
120
145
|
*/
|
|
121
146
|
simulate?: boolean;
|
|
122
|
-
}) => Promise<AssembledTransaction<
|
|
147
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
123
148
|
/**
|
|
124
|
-
* Construct and simulate a
|
|
149
|
+
* Construct and simulate a update_contract_code transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
125
150
|
*/
|
|
126
|
-
|
|
151
|
+
update_contract_code: ({ hash }: {
|
|
127
152
|
hash: Buffer;
|
|
128
153
|
}, options?: {
|
|
129
154
|
/**
|
|
@@ -138,14 +163,15 @@ export interface Client {
|
|
|
138
163
|
* Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
|
|
139
164
|
*/
|
|
140
165
|
simulate?: boolean;
|
|
141
|
-
}) => Promise<AssembledTransaction<
|
|
166
|
+
}) => Promise<AssembledTransaction<null>>;
|
|
142
167
|
}
|
|
143
168
|
export declare class Client extends ContractClient {
|
|
144
169
|
readonly options: ContractClientOptions;
|
|
145
170
|
constructor(options: ContractClientOptions);
|
|
146
171
|
readonly fromJSON: {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
172
|
+
add_signer: (json: string) => AssembledTransaction<null>;
|
|
173
|
+
update_signer: (json: string) => AssembledTransaction<null>;
|
|
174
|
+
remove_signer: (json: string) => AssembledTransaction<null>;
|
|
175
|
+
update_contract_code: (json: string) => AssembledTransaction<null>;
|
|
150
176
|
};
|
|
151
177
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.3.0",
|
|
3
3
|
"name": "sac-sdk",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/index.ts",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"buffer": "6.0.3",
|
|
13
|
-
"@stellar/stellar-sdk": "
|
|
13
|
+
"@stellar/stellar-sdk": "13.0.0-beta.1"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"typescript": "5.6.2"
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { Buffer } from "buffer";
|
|
2
|
-
import { Address } from '@stellar/stellar-sdk/minimal';
|
|
3
2
|
import {
|
|
4
3
|
AssembledTransaction,
|
|
5
4
|
Client as ContractClient,
|
|
6
5
|
ClientOptions as ContractClientOptions,
|
|
7
6
|
Result,
|
|
8
7
|
Spec as ContractSpec,
|
|
9
|
-
} from '@stellar/stellar-sdk/contract';
|
|
8
|
+
} from '@stellar/stellar-sdk/minimal/contract';
|
|
10
9
|
import type {
|
|
11
10
|
u32,
|
|
12
11
|
i32,
|
|
@@ -19,14 +18,13 @@ import type {
|
|
|
19
18
|
Option,
|
|
20
19
|
Typepoint,
|
|
21
20
|
Duration,
|
|
22
|
-
} from '@stellar/stellar-sdk/contract';
|
|
21
|
+
} from '@stellar/stellar-sdk/minimal/contract';
|
|
23
22
|
|
|
24
23
|
if (typeof window !== 'undefined') {
|
|
25
24
|
//@ts-ignore Buffer exists
|
|
26
25
|
window.Buffer = window.Buffer || Buffer;
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
|
|
30
28
|
export const networks = {
|
|
31
29
|
testnet: {
|
|
32
30
|
networkPassphrase: "Test SDF Network ; September 2015",
|
|
@@ -45,7 +43,7 @@ export interface Client {
|
|
|
45
43
|
*
|
|
46
44
|
* The amount returned is the amount that spender is allowed to transfer
|
|
47
45
|
* out of from's balance. When the spender transfers amounts, the allowance
|
|
48
|
-
* will be reduced by the amount
|
|
46
|
+
* will be reduced by the amount transfered.
|
|
49
47
|
*
|
|
50
48
|
* # Arguments
|
|
51
49
|
*
|
|
@@ -102,7 +100,7 @@ export interface Client {
|
|
|
102
100
|
* The amount set is the amount that spender is approved to transfer out of
|
|
103
101
|
* from's balance. The spender will be allowed to transfer amounts, and
|
|
104
102
|
* when an amount is transferred the allowance will be reduced by the
|
|
105
|
-
* amount
|
|
103
|
+
* amount transfered.
|
|
106
104
|
*
|
|
107
105
|
* # Arguments
|
|
108
106
|
*
|
|
@@ -178,8 +176,8 @@ export interface Client {
|
|
|
178
176
|
*
|
|
179
177
|
* # Events
|
|
180
178
|
*
|
|
181
|
-
* Emits an event with topics `["burn", from: Address], data = amount:
|
|
182
|
-
* i128`
|
|
179
|
+
* Emits an event with topics `["burn", from: Address], data = [amount:
|
|
180
|
+
* i128]`
|
|
183
181
|
*/
|
|
184
182
|
burn: ({ from, amount }: { from: string, amount: i128 }, options?: {
|
|
185
183
|
/**
|
|
@@ -220,8 +218,8 @@ export interface Client {
|
|
|
220
218
|
*
|
|
221
219
|
* # Events
|
|
222
220
|
*
|
|
223
|
-
* Emits an event with topics `["burn", from: Address], data = amount:
|
|
224
|
-
* i128`
|
|
221
|
+
* Emits an event with topics `["burn", from: Address], data = [amount:
|
|
222
|
+
* i128]`
|
|
225
223
|
*/
|
|
226
224
|
burn_from: ({ spender, from, amount }: { spender: string, from: string, amount: i128 }, options?: {
|
|
227
225
|
/**
|
|
@@ -254,7 +252,7 @@ export interface Client {
|
|
|
254
252
|
* # Events
|
|
255
253
|
*
|
|
256
254
|
* Emits an event with topics `["clawback", admin: Address, to: Address],
|
|
257
|
-
* data = amount: i128`
|
|
255
|
+
* data = [amount: i128]`
|
|
258
256
|
*/
|
|
259
257
|
clawback: ({ from, amount }: { from: string, amount: i128 }, options?: {
|
|
260
258
|
/**
|
|
@@ -310,7 +308,7 @@ export interface Client {
|
|
|
310
308
|
* # Events
|
|
311
309
|
*
|
|
312
310
|
* Emits an event with topics `["mint", admin: Address, to: Address], data
|
|
313
|
-
* = amount: i128`
|
|
311
|
+
* = [amount: i128]`
|
|
314
312
|
*/
|
|
315
313
|
mint: ({ to, amount }: { to: string, amount: i128 }, options?: {
|
|
316
314
|
/**
|
|
@@ -481,7 +479,7 @@ export interface Client {
|
|
|
481
479
|
* # Events
|
|
482
480
|
*
|
|
483
481
|
* Emits an event with topics `["transfer", from: Address, to: Address],
|
|
484
|
-
* data = amount: i128`
|
|
482
|
+
* data = [amount: i128]`
|
|
485
483
|
*/
|
|
486
484
|
transfer: ({ from, to, amount }: { from: string, to: string, amount: i128 }, options?: {
|
|
487
485
|
/**
|
|
@@ -523,7 +521,7 @@ export interface Client {
|
|
|
523
521
|
* # Events
|
|
524
522
|
*
|
|
525
523
|
* Emits an event with topics `["transfer", from: Address, to: Address],
|
|
526
|
-
* data = amount: i128`
|
|
524
|
+
* data = [amount: i128]`
|
|
527
525
|
*/
|
|
528
526
|
transfer_from: ({ spender, from, to, amount }: { spender: string, from: string, to: string, amount: i128 }, options?: {
|
|
529
527
|
/**
|
|
@@ -546,22 +544,22 @@ export interface Client {
|
|
|
546
544
|
export class Client extends ContractClient {
|
|
547
545
|
constructor(public readonly options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ugb2YgdG9rZW5zIHdoaWNoIHdpbGwgYmUKd2l0aGRyYXduIGZyb20uCiogYHRvYCAtIFRoZSBhZGRyZXNzIHdoaWNoIHdpbGwgcmVjZWl2ZSB0aGUgdHJhbnNmZXJyZWQgdG9rZW5zLgoqIGBhbW91bnRgIC0gVGhlIGFtb3VudCBvZiB0b2tlbnMgdG8gYmUgdHJhbnNmZXJyZWQuCgojIEV2ZW50cwoKRW1pdHMgYW4gZXZlbnQgd2l0aCB0b3BpY3MgYFsidHJhbnNmZXIiLCBmcm9tOiBBZGRyZXNzLCB0bzogQWRkcmVzc10sCmRhdGEgPSBbYW1vdW50OiBpMTI4XWAAAAAADXRyYW5zZmVyX2Zyb20AAAAAAAAEAAAAAAAAAAdzcGVuZGVyAAAAABMAAAAAAAAABGZyb20AAAATAAAAAAAAAAJ0bwAAAAAAEwAAAAAAAAAGYW1vdW50AAAAAAALAAAAAA=="]),
|
|
565
563
|
options
|
|
566
564
|
)
|
|
567
565
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions } from '@stellar/stellar-sdk/contract';
|
|
2
|
-
import type { u32, i128 } from '@stellar/stellar-sdk/contract';
|
|
1
|
+
import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions } from '@stellar/stellar-sdk/minimal/contract';
|
|
2
|
+
import type { u32, i128 } from '@stellar/stellar-sdk/minimal/contract';
|
|
3
3
|
export declare const networks: {
|
|
4
4
|
readonly testnet: {
|
|
5
5
|
readonly networkPassphrase: "Test SDF Network ; September 2015";
|
|
@@ -14,7 +14,7 @@ export interface Client {
|
|
|
14
14
|
*
|
|
15
15
|
* The amount returned is the amount that spender is allowed to transfer
|
|
16
16
|
* out of from's balance. When the spender transfers amounts, the allowance
|
|
17
|
-
* will be reduced by the amount
|
|
17
|
+
* will be reduced by the amount transfered.
|
|
18
18
|
*
|
|
19
19
|
* # Arguments
|
|
20
20
|
*
|
|
@@ -70,7 +70,7 @@ export interface Client {
|
|
|
70
70
|
* The amount set is the amount that spender is approved to transfer out of
|
|
71
71
|
* from's balance. The spender will be allowed to transfer amounts, and
|
|
72
72
|
* when an amount is transferred the allowance will be reduced by the
|
|
73
|
-
* amount
|
|
73
|
+
* amount transfered.
|
|
74
74
|
*
|
|
75
75
|
* # Arguments
|
|
76
76
|
*
|
|
@@ -147,8 +147,8 @@ export interface Client {
|
|
|
147
147
|
*
|
|
148
148
|
* # Events
|
|
149
149
|
*
|
|
150
|
-
* Emits an event with topics `["burn", from: Address], data = amount:
|
|
151
|
-
* i128`
|
|
150
|
+
* Emits an event with topics `["burn", from: Address], data = [amount:
|
|
151
|
+
* i128]`
|
|
152
152
|
*/
|
|
153
153
|
burn: ({ from, amount }: {
|
|
154
154
|
from: string;
|
|
@@ -189,8 +189,8 @@ export interface Client {
|
|
|
189
189
|
*
|
|
190
190
|
* # Events
|
|
191
191
|
*
|
|
192
|
-
* Emits an event with topics `["burn", from: Address], data = amount:
|
|
193
|
-
* i128`
|
|
192
|
+
* Emits an event with topics `["burn", from: Address], data = [amount:
|
|
193
|
+
* i128]`
|
|
194
194
|
*/
|
|
195
195
|
burn_from: ({ spender, from, amount }: {
|
|
196
196
|
spender: string;
|
|
@@ -224,7 +224,7 @@ export interface Client {
|
|
|
224
224
|
* # Events
|
|
225
225
|
*
|
|
226
226
|
* Emits an event with topics `["clawback", admin: Address, to: Address],
|
|
227
|
-
* data = amount: i128`
|
|
227
|
+
* data = [amount: i128]`
|
|
228
228
|
*/
|
|
229
229
|
clawback: ({ from, amount }: {
|
|
230
230
|
from: string;
|
|
@@ -277,7 +277,7 @@ export interface Client {
|
|
|
277
277
|
* # Events
|
|
278
278
|
*
|
|
279
279
|
* Emits an event with topics `["mint", admin: Address, to: Address], data
|
|
280
|
-
* = amount: i128`
|
|
280
|
+
* = [amount: i128]`
|
|
281
281
|
*/
|
|
282
282
|
mint: ({ to, amount }: {
|
|
283
283
|
to: string;
|
|
@@ -438,7 +438,7 @@ export interface Client {
|
|
|
438
438
|
* # Events
|
|
439
439
|
*
|
|
440
440
|
* Emits an event with topics `["transfer", from: Address, to: Address],
|
|
441
|
-
* data = amount: i128`
|
|
441
|
+
* data = [amount: i128]`
|
|
442
442
|
*/
|
|
443
443
|
transfer: ({ from, to, amount }: {
|
|
444
444
|
from: string;
|
|
@@ -481,7 +481,7 @@ export interface Client {
|
|
|
481
481
|
* # Events
|
|
482
482
|
*
|
|
483
483
|
* Emits an event with topics `["transfer", from: Address, to: Address],
|
|
484
|
-
* data = amount: i128`
|
|
484
|
+
* data = [amount: i128]`
|
|
485
485
|
*/
|
|
486
486
|
transfer_from: ({ spender, from, to, amount }: {
|
|
487
487
|
spender: string;
|
package/src/index.ts
CHANGED
package/src/kit.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Client as FactoryClient } from 'passkey-factory-sdk'
|
|
2
2
|
import { Client as PasskeyClient, type Signature, type SignerKey as SDKSignerKey, type SignerLimits as SDKSignerLimits } from 'passkey-kit-sdk'
|
|
3
3
|
import { StrKey, hash, xdr, SorobanRpc, Keypair, Address } from '@stellar/stellar-sdk/minimal'
|
|
4
|
-
import { AssembledTransaction, DEFAULT_TIMEOUT, type Tx } from '@stellar/stellar-sdk/contract'
|
|
5
4
|
import type { AuthenticatorAttestationResponseJSON, AuthenticatorSelectionCriteria } from "@simplewebauthn/types"
|
|
6
5
|
import { startRegistration, startAuthentication } from "@simplewebauthn/browser"
|
|
7
6
|
import { Buffer } from 'buffer'
|
|
8
7
|
import base64url from 'base64url'
|
|
9
8
|
import type { SignerKey, SignerLimits, SignerStore } from './types'
|
|
10
9
|
import { PasskeyBase } from './base'
|
|
10
|
+
import { AssembledTransaction, DEFAULT_TIMEOUT, type Tx, type Spec } from '@stellar/stellar-sdk/minimal/contract'
|
|
11
11
|
|
|
12
12
|
// TODO Return base64url encoded strings as well as buffers
|
|
13
13
|
|
|
@@ -55,6 +55,7 @@ export class PasskeyKit extends PasskeyBase {
|
|
|
55
55
|
values: [
|
|
56
56
|
keyId,
|
|
57
57
|
publicKey,
|
|
58
|
+
undefined,
|
|
58
59
|
[new Map()],
|
|
59
60
|
{ tag: 'Persistent', values: undefined },
|
|
60
61
|
]
|
|
@@ -91,20 +92,22 @@ export class PasskeyKit extends PasskeyBase {
|
|
|
91
92
|
const displayName = `${user} — ${now.toLocaleString()}`
|
|
92
93
|
const { rpId, authenticatorSelection } = settings || {}
|
|
93
94
|
const { id, response } = await this.WebAuthn.startRegistration({
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
95
|
+
optionsJSON: {
|
|
96
|
+
challenge: base64url("stellaristhebetterblockchain"),
|
|
97
|
+
rp: {
|
|
98
|
+
id: rpId,
|
|
99
|
+
name: app,
|
|
100
|
+
},
|
|
101
|
+
user: {
|
|
102
|
+
id: base64url(`${user}:${now.getTime()}:${Math.random()}`),
|
|
103
|
+
name: displayName,
|
|
104
|
+
displayName
|
|
105
|
+
},
|
|
106
|
+
authenticatorSelection,
|
|
107
|
+
pubKeyCredParams: [{ alg: -7, type: "public-key" }],
|
|
108
|
+
// attestation: "none",
|
|
109
|
+
// timeout: 120_000,
|
|
110
|
+
}
|
|
108
111
|
});
|
|
109
112
|
|
|
110
113
|
if (!this.keyId)
|
|
@@ -127,10 +130,12 @@ export class PasskeyKit extends PasskeyBase {
|
|
|
127
130
|
|
|
128
131
|
if (!keyId) {
|
|
129
132
|
const response = await this.WebAuthn.startAuthentication({
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
133
|
+
optionsJSON: {
|
|
134
|
+
challenge: base64url("stellaristhebetterblockchain"),
|
|
135
|
+
rpId,
|
|
136
|
+
// userVerification: "discouraged",
|
|
137
|
+
// timeout: 120_000
|
|
138
|
+
}
|
|
134
139
|
});
|
|
135
140
|
|
|
136
141
|
keyId = response.id
|
|
@@ -206,8 +211,8 @@ export class PasskeyKit extends PasskeyBase {
|
|
|
206
211
|
expiration = credentials.signatureExpirationLedger()
|
|
207
212
|
|
|
208
213
|
if (!expiration) {
|
|
209
|
-
const
|
|
210
|
-
expiration =
|
|
214
|
+
const { sequence } = await this.rpc.getLatestLedger()
|
|
215
|
+
expiration = sequence + DEFAULT_TIMEOUT / 5;
|
|
211
216
|
}
|
|
212
217
|
}
|
|
213
218
|
|
|
@@ -265,8 +270,8 @@ export class PasskeyKit extends PasskeyBase {
|
|
|
265
270
|
|
|
266
271
|
// Default, use passkey
|
|
267
272
|
else {
|
|
268
|
-
const authenticationResponse = await this.WebAuthn.startAuthentication(
|
|
269
|
-
keyId === 'any'
|
|
273
|
+
const authenticationResponse = await this.WebAuthn.startAuthentication({
|
|
274
|
+
optionsJSON: keyId === 'any'
|
|
270
275
|
|| (!keyId && !this.keyId)
|
|
271
276
|
? {
|
|
272
277
|
challenge: base64url(payload),
|
|
@@ -288,7 +293,7 @@ export class PasskeyKit extends PasskeyBase {
|
|
|
288
293
|
// userVerification: "discouraged",
|
|
289
294
|
// timeout: 120_000
|
|
290
295
|
}
|
|
291
|
-
);
|
|
296
|
+
});
|
|
292
297
|
|
|
293
298
|
key = {
|
|
294
299
|
tag: "Secp256r1",
|
|
@@ -400,40 +405,69 @@ export class PasskeyKit extends PasskeyBase {
|
|
|
400
405
|
return txn
|
|
401
406
|
}
|
|
402
407
|
|
|
403
|
-
public addSecp256r1(keyId: string | Uint8Array, publicKey: string | Uint8Array, limits: SignerLimits, store: SignerStore) {
|
|
408
|
+
public addSecp256r1(keyId: string | Uint8Array, publicKey: string | Uint8Array, limits: SignerLimits, store: SignerStore, expiration?: number) {
|
|
409
|
+
return this.secp256r1(keyId, publicKey, limits, store, 'add_signer', expiration)
|
|
410
|
+
}
|
|
411
|
+
public addEd25519(publicKey: string, limits: SignerLimits, store: SignerStore, expiration?: number) {
|
|
412
|
+
return this.ed25519(publicKey, limits, store, 'add_signer', expiration)
|
|
413
|
+
}
|
|
414
|
+
public addPolicy(policy: string, limits: SignerLimits, store: SignerStore, expiration?: number) {
|
|
415
|
+
return this.policy(policy, limits, store, 'add_signer', expiration)
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
public updateSecp256r1(keyId: string | Uint8Array, publicKey: string | Uint8Array, limits: SignerLimits, store: SignerStore, expiration?: number) {
|
|
419
|
+
return this.secp256r1(keyId, publicKey, limits, store, 'update_signer', expiration)
|
|
420
|
+
}
|
|
421
|
+
public updateEd25519(publicKey: string, limits: SignerLimits, store: SignerStore, expiration?: number) {
|
|
422
|
+
return this.ed25519(publicKey, limits, store, 'update_signer', expiration)
|
|
423
|
+
}
|
|
424
|
+
public updatePolicy(policy: string, limits: SignerLimits, store: SignerStore, expiration?: number) {
|
|
425
|
+
return this.policy(policy, limits, store, 'update_signer', expiration)
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
public remove(signer: SignerKey) {
|
|
429
|
+
return this.wallet!.remove_signer({
|
|
430
|
+
signer_key: this.getSignerKey(signer)
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
private secp256r1(keyId: string | Uint8Array, publicKey: string | Uint8Array, limits: SignerLimits, store: SignerStore, fn: 'add_signer' | 'update_signer', expiration?: number) {
|
|
404
435
|
keyId = typeof keyId === 'string' ? base64url.toBuffer(keyId) : keyId
|
|
405
436
|
publicKey = typeof publicKey === 'string' ? base64url.toBuffer(publicKey) : publicKey
|
|
406
437
|
|
|
407
|
-
return this.wallet
|
|
438
|
+
return this.wallet,
|
|
412
443
|
Buffer.from(publicKey),
|
|
444
|
+
expiration,
|
|
413
445
|
this.getSignerLimits(limits),
|
|
414
446
|
{ tag: store, values: undefined },
|
|
415
447
|
],
|
|
416
448
|
},
|
|
417
449
|
});
|
|
418
450
|
}
|
|
419
|
-
|
|
420
|
-
return this.wallet
|
|
451
|
+
private ed25519(publicKey: string, limits: SignerLimits, store: SignerStore, fn: 'add_signer' | 'update_signer', expiration?: number) {
|
|
452
|
+
return this.wallet.rawPublicKey(),
|
|
457
|
+
expiration,
|
|
425
458
|
this.getSignerLimits(limits),
|
|
426
459
|
{ tag: store, values: undefined },
|
|
427
460
|
],
|
|
428
461
|
},
|
|
429
462
|
});
|
|
430
463
|
}
|
|
431
|
-
|
|
432
|
-
return this.wallet
|
|
464
|
+
private policy(policy: string, limits: SignerLimits, store: SignerStore, fn: 'add_signer' | 'update_signer', expiration?: number) {
|
|
465
|
+
return this.wallet,
|
|
438
472
|
{ tag: store, values: undefined },
|
|
439
473
|
],
|
|
@@ -441,12 +475,6 @@ export class PasskeyKit extends PasskeyBase {
|
|
|
441
475
|
});
|
|
442
476
|
}
|
|
443
477
|
|
|
444
|
-
public remove(signer: SignerKey) {
|
|
445
|
-
return this.wallet!.remove({
|
|
446
|
-
signer_key: this.getSignerKey(signer)
|
|
447
|
-
});
|
|
448
|
-
}
|
|
449
|
-
|
|
450
478
|
/* LATER
|
|
451
479
|
- Add a getKeyInfo action to get info about a specific passkey
|
|
452
480
|
Specifically looking for name, type, etc. data so a user could grok what signer mapped to what passkey
|
package/src/server.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { SorobanRpc, Transaction, xdr } from "@stellar/stellar-sdk/minimal"
|
|
2
2
|
import { PasskeyBase } from "./base"
|
|
3
3
|
import base64url from "base64url"
|
|
4
|
-
import type { Tx } from "@stellar/stellar-sdk/contract"
|
|
4
|
+
import type { Tx } from "@stellar/stellar-sdk/minimal/contract"
|
|
5
|
+
import type { Signer } from "./types"
|
|
6
|
+
import { AssembledTransaction } from "@stellar/stellar-sdk/minimal/contract"
|
|
5
7
|
|
|
6
8
|
export class PasskeyServer extends PasskeyBase {
|
|
7
9
|
public launchtubeUrl: string | undefined
|
|
8
10
|
public launchtubeJwt: string | undefined
|
|
11
|
+
public mercuryProjectName: string | undefined
|
|
9
12
|
public mercuryUrl: string | undefined
|
|
10
13
|
public mercuryJwt: string | undefined
|
|
11
14
|
public mercuryKey: string | undefined
|
|
@@ -14,6 +17,7 @@ export class PasskeyServer extends PasskeyBase {
|
|
|
14
17
|
rpcUrl?: string,
|
|
15
18
|
launchtubeUrl?: string,
|
|
16
19
|
launchtubeJwt?: string,
|
|
20
|
+
mercuryProjectName?: string,
|
|
17
21
|
mercuryUrl?: string,
|
|
18
22
|
mercuryJwt?: string,
|
|
19
23
|
mercuryKey?: string,
|
|
@@ -22,6 +26,7 @@ export class PasskeyServer extends PasskeyBase {
|
|
|
22
26
|
rpcUrl,
|
|
23
27
|
launchtubeUrl,
|
|
24
28
|
launchtubeJwt,
|
|
29
|
+
mercuryProjectName,
|
|
25
30
|
mercuryUrl,
|
|
26
31
|
mercuryJwt,
|
|
27
32
|
mercuryKey,
|
|
@@ -35,6 +40,9 @@ export class PasskeyServer extends PasskeyBase {
|
|
|
35
40
|
if (launchtubeJwt)
|
|
36
41
|
this.launchtubeJwt = launchtubeJwt
|
|
37
42
|
|
|
43
|
+
if (mercuryProjectName)
|
|
44
|
+
this.mercuryProjectName = mercuryProjectName
|
|
45
|
+
|
|
38
46
|
if (mercuryUrl)
|
|
39
47
|
this.mercuryUrl = mercuryUrl
|
|
40
48
|
|
|
@@ -46,7 +54,7 @@ export class PasskeyServer extends PasskeyBase {
|
|
|
46
54
|
}
|
|
47
55
|
|
|
48
56
|
public async getSigners(contractId: string) {
|
|
49
|
-
if (!this.rpc || !this.mercuryUrl || (!this.mercuryJwt && !this.mercuryKey))
|
|
57
|
+
if (!this.rpc || !this.mercuryProjectName || !this.mercuryUrl || (!this.mercuryJwt && !this.mercuryKey))
|
|
50
58
|
throw new Error('Mercury service not configured')
|
|
51
59
|
|
|
52
60
|
const signers = await fetch(`${this.mercuryUrl}/zephyr/execute`, {
|
|
@@ -56,7 +64,7 @@ export class PasskeyServer extends PasskeyBase {
|
|
|
56
64
|
Authorization: this.mercuryJwt ? `Bearer ${this.mercuryJwt}` : this.mercuryKey!
|
|
57
65
|
},
|
|
58
66
|
body: JSON.stringify({
|
|
59
|
-
project_name:
|
|
67
|
+
project_name: this.mercuryProjectName,
|
|
60
68
|
mode: {
|
|
61
69
|
Function: {
|
|
62
70
|
fname: "get_signers_by_address",
|
|
@@ -75,22 +83,16 @@ export class PasskeyServer extends PasskeyBase {
|
|
|
75
83
|
})
|
|
76
84
|
|
|
77
85
|
for (const signer of signers) {
|
|
78
|
-
if (
|
|
86
|
+
if (signer.storage === 'Temporary') {
|
|
79
87
|
try {
|
|
80
88
|
await this.rpc.getContractData(contractId, xdr.ScVal.scvBytes(base64url.toBuffer(signer.key)), SorobanRpc.Durability.Temporary)
|
|
81
89
|
} catch {
|
|
82
|
-
signer.
|
|
90
|
+
signer.evicted = true
|
|
83
91
|
}
|
|
84
92
|
}
|
|
85
93
|
}
|
|
86
94
|
|
|
87
|
-
return signers as
|
|
88
|
-
kind: string,
|
|
89
|
-
key: string,
|
|
90
|
-
val: string,
|
|
91
|
-
limits: string,
|
|
92
|
-
expired?: boolean
|
|
93
|
-
}[]
|
|
95
|
+
return signers as Signer[]
|
|
94
96
|
}
|
|
95
97
|
|
|
96
98
|
public async getContractId(options: {
|
|
@@ -98,7 +100,7 @@ export class PasskeyServer extends PasskeyBase {
|
|
|
98
100
|
publicKey?: string,
|
|
99
101
|
policy?: string,
|
|
100
102
|
}, index = 0) {
|
|
101
|
-
if (!this.mercuryUrl || (!this.mercuryJwt && !this.mercuryKey))
|
|
103
|
+
if (!this.mercuryProjectName || !this.mercuryUrl || (!this.mercuryJwt && !this.mercuryKey))
|
|
102
104
|
throw new Error('Mercury service not configured')
|
|
103
105
|
|
|
104
106
|
let { keyId, publicKey, policy } = options || {}
|
|
@@ -122,7 +124,7 @@ export class PasskeyServer extends PasskeyBase {
|
|
|
122
124
|
Authorization: this.mercuryJwt ? `Bearer ${this.mercuryJwt}` : this.mercuryKey!
|
|
123
125
|
},
|
|
124
126
|
body: JSON.stringify({
|
|
125
|
-
project_name:
|
|
127
|
+
project_name: this.mercuryProjectName,
|
|
126
128
|
mode: {
|
|
127
129
|
Function: {
|
|
128
130
|
fname: "get_addresses_by_signer",
|
|
@@ -145,13 +147,19 @@ export class PasskeyServer extends PasskeyBase {
|
|
|
145
147
|
- Add a method for getting a paginated or filtered list of all a wallet's events
|
|
146
148
|
*/
|
|
147
149
|
|
|
148
|
-
public async send(txn: Tx | string, fee?: number) {
|
|
150
|
+
public async send<T>(txn: AssembledTransaction<T> | Tx | string, fee?: number) {
|
|
149
151
|
if (!this.launchtubeUrl || !this.launchtubeJwt)
|
|
150
152
|
throw new Error('Launchtube service not configured')
|
|
151
153
|
|
|
152
154
|
const data = new FormData();
|
|
153
155
|
|
|
154
|
-
|
|
156
|
+
if (txn instanceof AssembledTransaction) {
|
|
157
|
+
txn = txn.built!.toXDR()
|
|
158
|
+
} else if (typeof txn !== 'string') {
|
|
159
|
+
txn = txn.toXDR()
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
data.set('xdr', txn);
|
|
155
163
|
|
|
156
164
|
if (fee)
|
|
157
165
|
data.set('fee', fee.toString());
|
package/src/types.ts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
export type Signer = {
|
|
2
|
+
kind: string
|
|
3
|
+
key: string
|
|
4
|
+
val: string
|
|
5
|
+
expiration: number | null
|
|
6
|
+
storage: "Persistent" | "Temporary"
|
|
7
|
+
limits: string
|
|
8
|
+
evicted?: boolean
|
|
9
|
+
}
|
|
10
|
+
|
|
1
11
|
export class SignerKey {
|
|
2
12
|
private constructor(public key: "Policy" | "Ed25519" | "Secp256r1", public value: string) { }
|
|
3
13
|
|
package/types/index.d.ts
CHANGED
package/types/kit.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Client as FactoryClient } from 'passkey-factory-sdk';
|
|
2
2
|
import { Client as PasskeyClient } from 'passkey-kit-sdk';
|
|
3
3
|
import { xdr, SorobanRpc, Keypair } from '@stellar/stellar-sdk/minimal';
|
|
4
|
-
import { AssembledTransaction, type Tx } from '@stellar/stellar-sdk/contract';
|
|
5
4
|
import type { AuthenticatorSelectionCriteria } from "@simplewebauthn/types";
|
|
6
5
|
import { startRegistration, startAuthentication } from "@simplewebauthn/browser";
|
|
7
6
|
import { Buffer } from 'buffer';
|
|
8
7
|
import type { SignerKey, SignerLimits, SignerStore } from './types';
|
|
9
8
|
import { PasskeyBase } from './base';
|
|
9
|
+
import { AssembledTransaction, type Tx } from '@stellar/stellar-sdk/minimal/contract';
|
|
10
10
|
export declare class PasskeyKit extends PasskeyBase {
|
|
11
11
|
rpc: SorobanRpc.Server;
|
|
12
12
|
rpcUrl: string;
|
|
@@ -64,10 +64,16 @@ export declare class PasskeyKit extends PasskeyBase {
|
|
|
64
64
|
policy?: string;
|
|
65
65
|
expiration?: number;
|
|
66
66
|
}): Promise<AssembledTransaction<T>>;
|
|
67
|
-
addSecp256r1(keyId: string | Uint8Array, publicKey: string | Uint8Array, limits: SignerLimits, store: SignerStore): Promise<AssembledTransaction<
|
|
68
|
-
addEd25519(publicKey: string, limits: SignerLimits, store: SignerStore): Promise<AssembledTransaction<
|
|
69
|
-
addPolicy(policy: string, limits: SignerLimits, store: SignerStore): Promise<AssembledTransaction<
|
|
70
|
-
|
|
67
|
+
addSecp256r1(keyId: string | Uint8Array, publicKey: string | Uint8Array, limits: SignerLimits, store: SignerStore, expiration?: number): Promise<AssembledTransaction<null>>;
|
|
68
|
+
addEd25519(publicKey: string, limits: SignerLimits, store: SignerStore, expiration?: number): Promise<AssembledTransaction<null>>;
|
|
69
|
+
addPolicy(policy: string, limits: SignerLimits, store: SignerStore, expiration?: number): Promise<AssembledTransaction<null>>;
|
|
70
|
+
updateSecp256r1(keyId: string | Uint8Array, publicKey: string | Uint8Array, limits: SignerLimits, store: SignerStore, expiration?: number): Promise<AssembledTransaction<null>>;
|
|
71
|
+
updateEd25519(publicKey: string, limits: SignerLimits, store: SignerStore, expiration?: number): Promise<AssembledTransaction<null>>;
|
|
72
|
+
updatePolicy(policy: string, limits: SignerLimits, store: SignerStore, expiration?: number): Promise<AssembledTransaction<null>>;
|
|
73
|
+
remove(signer: SignerKey): Promise<AssembledTransaction<null>>;
|
|
74
|
+
private secp256r1;
|
|
75
|
+
private ed25519;
|
|
76
|
+
private policy;
|
|
71
77
|
private getSignerLimits;
|
|
72
78
|
private getSignerKey;
|
|
73
79
|
private getPublicKey;
|
package/types/server.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { PasskeyBase } from "./base";
|
|
2
|
-
import type { Tx } from "@stellar/stellar-sdk/contract";
|
|
2
|
+
import type { Tx } from "@stellar/stellar-sdk/minimal/contract";
|
|
3
|
+
import type { Signer } from "./types";
|
|
4
|
+
import { AssembledTransaction } from "@stellar/stellar-sdk/minimal/contract";
|
|
3
5
|
export declare class PasskeyServer extends PasskeyBase {
|
|
4
6
|
launchtubeUrl: string | undefined;
|
|
5
7
|
launchtubeJwt: string | undefined;
|
|
8
|
+
mercuryProjectName: string | undefined;
|
|
6
9
|
mercuryUrl: string | undefined;
|
|
7
10
|
mercuryJwt: string | undefined;
|
|
8
11
|
mercuryKey: string | undefined;
|
|
@@ -10,21 +13,16 @@ export declare class PasskeyServer extends PasskeyBase {
|
|
|
10
13
|
rpcUrl?: string;
|
|
11
14
|
launchtubeUrl?: string;
|
|
12
15
|
launchtubeJwt?: string;
|
|
16
|
+
mercuryProjectName?: string;
|
|
13
17
|
mercuryUrl?: string;
|
|
14
18
|
mercuryJwt?: string;
|
|
15
19
|
mercuryKey?: string;
|
|
16
20
|
});
|
|
17
|
-
getSigners(contractId: string): Promise<
|
|
18
|
-
kind: string;
|
|
19
|
-
key: string;
|
|
20
|
-
val: string;
|
|
21
|
-
limits: string;
|
|
22
|
-
expired?: boolean;
|
|
23
|
-
}[]>;
|
|
21
|
+
getSigners(contractId: string): Promise<Signer[]>;
|
|
24
22
|
getContractId(options: {
|
|
25
23
|
keyId?: string;
|
|
26
24
|
publicKey?: string;
|
|
27
25
|
policy?: string;
|
|
28
26
|
}, index?: number): Promise<string>;
|
|
29
|
-
send(txn: Tx | string, fee?: number): Promise<any>;
|
|
27
|
+
send<T>(txn: AssembledTransaction<T> | Tx | string, fee?: number): Promise<any>;
|
|
30
28
|
}
|
package/types/types.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
export type Signer = {
|
|
2
|
+
kind: string;
|
|
3
|
+
key: string;
|
|
4
|
+
val: string;
|
|
5
|
+
expiration: number | null;
|
|
6
|
+
storage: "Persistent" | "Temporary";
|
|
7
|
+
limits: string;
|
|
8
|
+
evicted?: boolean;
|
|
9
|
+
};
|
|
1
10
|
export declare class SignerKey {
|
|
2
11
|
key: "Policy" | "Ed25519" | "Secp256r1";
|
|
3
12
|
value: string;
|