Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(signer): Update signer release to 0.2.3 #2744

Merged
merged 4 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/build.signer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ print_help() {

DFX_NETWORK="${DFX_NETWORK:-local}"

SIGNER_RELEASE="v0.2.2"
SIGNER_RELEASE="v0.2.3"
SIGNER_RELEASE_URL="https://github.com/dfinity/chain-fusion-signer/releases/download/${SIGNER_RELEASE}"
CANDID_URL="${SIGNER_RELEASE_URL}/signer.did"
WASM_URL="${SIGNER_RELEASE_URL}/signer.wasm.gz"
Expand Down
51 changes: 40 additions & 11 deletions src/declarations/signer/signer.did
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ type Arg = variant { Upgrade; Init : InitArg };
type BitcoinAddressType = variant { P2WPKH };
type BitcoinNetwork = variant { mainnet; regtest; testnet };
type BtcTxOutput = record { destination_address : text; sent_satoshis : nat64 };
type BuildP2wpkhTxError = variant {
NotEnoughFunds : record { available : nat64; required : nat64 };
WrongBitcoinNetwork;
NotP2WPKHSourceAddress;
InvalidDestinationAddress : GetAddressResponse;
InvalidSourceAddress : GetAddressResponse;
};
type CallerPaysIcrc2Tokens = record { ledger : principal };
type CanisterStatusResultV2 = record {
controller : principal;
Expand Down Expand Up @@ -36,10 +43,26 @@ type EcdsaPublicKeyArgument = record {
derivation_path : vec blob;
};
type EcdsaPublicKeyResponse = record { public_key : blob; chain_code : blob };
type GenericSigningError = variant {
type EthAddressError = variant {
SigningError : record { RejectionCode_1; text };
PaymentError : PaymentError;
};
type EthAddressRequest = record { "principal" : opt principal };
type EthAddressResponse = record { address : text };
type EthPersonalSignRequest = record { message : text };
type EthPersonalSignResponse = record { signature : text };
type EthSignPrehashRequest = record { message : text };
type EthSignPrehashResponse = record { signature : text };
type EthSignTransactionRequest = record {
to : text;
gas : nat;
value : nat;
max_priority_fee_per_gas : nat;
data : opt text;
max_fee_per_gas : nat;
chain_id : nat;
nonce : nat;
};
type GetAddressError = variant {
InternalError : record { msg : text };
PaymentError : PaymentError;
Expand Down Expand Up @@ -109,16 +132,19 @@ type RejectionCode_1 = variant {
type Result = variant { Ok : GetAddressResponse; Err : GetAddressError };
type Result_1 = variant { Ok : GetBalanceResponse; Err : GetAddressError };
type Result_2 = variant { Ok : SendBtcResponse; Err : SendBtcError };
type Result_3 = variant { Ok : text; Err : GenericSigningError };
type Result_4 = variant {
type Result_3 = variant { Ok : EthAddressResponse; Err : EthAddressError };
type Result_4 = variant { Ok : EthPersonalSignResponse; Err : EthAddressError };
type Result_5 = variant { Ok : EthSignPrehashResponse; Err : EthAddressError };
type Result_6 = variant {
Ok : record { EcdsaPublicKeyResponse };
Err : GenericSigningError;
Err : EthAddressError;
};
type Result_5 = variant {
type Result_7 = variant {
Ok : record { SignWithEcdsaResponse };
Err : GenericSigningError;
Err : EthAddressError;
};
type SendBtcError = variant {
BuildP2wpkhError : BuildP2wpkhTxError;
InternalError : record { msg : text };
PaymentError : PaymentError;
};
Expand Down Expand Up @@ -181,17 +207,20 @@ service : (Arg) -> {
btc_caller_send : (SendBtcRequest, opt PaymentType) -> (Result_2);
caller_eth_address : () -> (text);
config : () -> (Config) query;
eth_address : (EthAddressRequest, opt PaymentType) -> (Result_3);
eth_address_of : (principal) -> (text);
eth_address_of_caller : (opt PaymentType) -> (Result_3);
eth_address_of_principal : (principal, opt PaymentType) -> (Result_3);
eth_personal_sign : (text, opt PaymentType) -> (Result_3);
eth_sign_transaction : (SignRequest, opt PaymentType) -> (Result_3);
eth_personal_sign : (EthPersonalSignRequest, opt PaymentType) -> (Result_4);
eth_sign_prehash : (EthSignPrehashRequest, opt PaymentType) -> (Result_5);
eth_sign_transaction : (EthSignTransactionRequest, opt PaymentType) -> (
Result_5,
);
generic_caller_ecdsa_public_key : (
EcdsaPublicKeyArgument,
opt PaymentType,
) -> (Result_4);
) -> (Result_6);
generic_sign_with_ecdsa : (opt PaymentType, SignWithEcdsaArgument) -> (
Result_5,
Result_7,
);
get_canister_status : () -> (CanisterStatusResultV2);
http_request : (HttpRequest) -> (HttpResponse) query;
Expand Down
66 changes: 53 additions & 13 deletions src/declarations/signer/signer.did.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ export interface BtcTxOutput {
destination_address: string;
sent_satoshis: bigint;
}
export type BuildP2wpkhTxError =
| {
NotEnoughFunds: { available: bigint; required: bigint };
}
| { WrongBitcoinNetwork: null }
| { NotP2WPKHSourceAddress: null }
| { InvalidDestinationAddress: GetAddressResponse }
| { InvalidSourceAddress: GetAddressResponse };
export interface CallerPaysIcrc2Tokens {
ledger: Principal;
}
Expand Down Expand Up @@ -54,11 +62,37 @@ export interface EcdsaPublicKeyResponse {
public_key: Uint8Array | number[];
chain_code: Uint8Array | number[];
}
export type GenericSigningError =
| {
SigningError: [RejectionCode_1, string];
}
export type EthAddressError =
| { SigningError: [RejectionCode_1, string] }
| { PaymentError: PaymentError };
export interface EthAddressRequest {
principal: [] | [Principal];
}
export interface EthAddressResponse {
address: string;
}
export interface EthPersonalSignRequest {
message: string;
}
export interface EthPersonalSignResponse {
signature: string;
}
export interface EthSignPrehashRequest {
message: string;
}
export interface EthSignPrehashResponse {
signature: string;
}
export interface EthSignTransactionRequest {
to: string;
gas: bigint;
value: bigint;
max_priority_fee_per_gas: bigint;
data: [] | [string];
max_fee_per_gas: bigint;
chain_id: bigint;
nonce: bigint;
}
export type GetAddressError = { InternalError: { msg: string } } | { PaymentError: PaymentError };
export interface GetAddressRequest {
network: BitcoinNetwork;
Expand Down Expand Up @@ -135,10 +169,15 @@ export type RejectionCode_1 =
export type Result = { Ok: GetAddressResponse } | { Err: GetAddressError };
export type Result_1 = { Ok: GetBalanceResponse } | { Err: GetAddressError };
export type Result_2 = { Ok: SendBtcResponse } | { Err: SendBtcError };
export type Result_3 = { Ok: string } | { Err: GenericSigningError };
export type Result_4 = { Ok: [EcdsaPublicKeyResponse] } | { Err: GenericSigningError };
export type Result_5 = { Ok: [SignWithEcdsaResponse] } | { Err: GenericSigningError };
export type SendBtcError = { InternalError: { msg: string } } | { PaymentError: PaymentError };
export type Result_3 = { Ok: EthAddressResponse } | { Err: EthAddressError };
export type Result_4 = { Ok: EthPersonalSignResponse } | { Err: EthAddressError };
export type Result_5 = { Ok: EthSignPrehashResponse } | { Err: EthAddressError };
export type Result_6 = { Ok: [EcdsaPublicKeyResponse] } | { Err: EthAddressError };
export type Result_7 = { Ok: [SignWithEcdsaResponse] } | { Err: EthAddressError };
export type SendBtcError =
| { BuildP2wpkhError: BuildP2wpkhTxError }
| { InternalError: { msg: string } }
| { PaymentError: PaymentError };
export interface SendBtcRequest {
fee_satoshis: [] | [bigint];
network: BitcoinNetwork;
Expand Down Expand Up @@ -210,16 +249,17 @@ export interface _SERVICE {
btc_caller_send: ActorMethod<[SendBtcRequest, [] | [PaymentType]], Result_2>;
caller_eth_address: ActorMethod<[], string>;
config: ActorMethod<[], Config>;
eth_address: ActorMethod<[EthAddressRequest, [] | [PaymentType]], Result_3>;
eth_address_of: ActorMethod<[Principal], string>;
eth_address_of_caller: ActorMethod<[[] | [PaymentType]], Result_3>;
eth_address_of_principal: ActorMethod<[Principal, [] | [PaymentType]], Result_3>;
eth_personal_sign: ActorMethod<[string, [] | [PaymentType]], Result_3>;
eth_sign_transaction: ActorMethod<[SignRequest, [] | [PaymentType]], Result_3>;
eth_personal_sign: ActorMethod<[EthPersonalSignRequest, [] | [PaymentType]], Result_4>;
eth_sign_prehash: ActorMethod<[EthSignPrehashRequest, [] | [PaymentType]], Result_5>;
eth_sign_transaction: ActorMethod<[EthSignTransactionRequest, [] | [PaymentType]], Result_5>;
generic_caller_ecdsa_public_key: ActorMethod<
[EcdsaPublicKeyArgument, [] | [PaymentType]],
Result_4
Result_6
>;
generic_sign_with_ecdsa: ActorMethod<[[] | [PaymentType], SignWithEcdsaArgument], Result_5>;
generic_sign_with_ecdsa: ActorMethod<[[] | [PaymentType], SignWithEcdsaArgument], Result_7>;
get_canister_status: ActorMethod<[], CanisterStatusResultV2>;
http_request: ActorMethod<[HttpRequest], HttpResponse>;
personal_sign: ActorMethod<[string], string>;
Expand Down
68 changes: 55 additions & 13 deletions src/declarations/signer/signer.factory.certified.did.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,18 @@ export const idlFactory = ({ IDL }) => {
outputs: IDL.Vec(BtcTxOutput)
});
const SendBtcResponse = IDL.Record({ txid: IDL.Text });
const BuildP2wpkhTxError = IDL.Variant({
NotEnoughFunds: IDL.Record({
available: IDL.Nat64,
required: IDL.Nat64
}),
WrongBitcoinNetwork: IDL.Null,
NotP2WPKHSourceAddress: IDL.Null,
InvalidDestinationAddress: GetAddressResponse,
InvalidSourceAddress: GetAddressResponse
});
const SendBtcError = IDL.Variant({
BuildP2wpkhError: BuildP2wpkhTxError,
InternalError: IDL.Record({ msg: IDL.Text }),
PaymentError: PaymentError
});
Expand All @@ -139,15 +150,31 @@ export const idlFactory = ({ IDL }) => {
ic_root_key_raw: IDL.Opt(IDL.Vec(IDL.Nat8)),
cycles_ledger: IDL.Principal
});
const GenericSigningError = IDL.Variant({
const EthAddressRequest = IDL.Record({
principal: IDL.Opt(IDL.Principal)
});
const EthAddressResponse = IDL.Record({ address: IDL.Text });
const EthAddressError = IDL.Variant({
SigningError: IDL.Tuple(RejectionCode_1, IDL.Text),
PaymentError: PaymentError
});
const Result_3 = IDL.Variant({
Ok: IDL.Text,
Err: GenericSigningError
Ok: EthAddressResponse,
Err: EthAddressError
});
const SignRequest = IDL.Record({
bitdivine marked this conversation as resolved.
Show resolved Hide resolved
const EthPersonalSignRequest = IDL.Record({ message: IDL.Text });
const EthPersonalSignResponse = IDL.Record({ signature: IDL.Text });
const Result_4 = IDL.Variant({
Ok: EthPersonalSignResponse,
Err: EthAddressError
});
const EthSignPrehashRequest = IDL.Record({ message: IDL.Text });
const EthSignPrehashResponse = IDL.Record({ signature: IDL.Text });
const Result_5 = IDL.Variant({
Ok: EthSignPrehashResponse,
Err: EthAddressError
});
const EthSignTransactionRequest = IDL.Record({
to: IDL.Text,
gas: IDL.Nat,
value: IDL.Nat,
Expand All @@ -168,19 +195,19 @@ export const idlFactory = ({ IDL }) => {
public_key: IDL.Vec(IDL.Nat8),
chain_code: IDL.Vec(IDL.Nat8)
});
const Result_4 = IDL.Variant({
const Result_6 = IDL.Variant({
Ok: IDL.Tuple(EcdsaPublicKeyResponse),
Err: GenericSigningError
Err: EthAddressError
});
const SignWithEcdsaArgument = IDL.Record({
key_id: EcdsaKeyId,
derivation_path: IDL.Vec(IDL.Vec(IDL.Nat8)),
message_hash: IDL.Vec(IDL.Nat8)
});
const SignWithEcdsaResponse = IDL.Record({ signature: IDL.Vec(IDL.Nat8) });
const Result_5 = IDL.Variant({
const Result_7 = IDL.Variant({
Ok: IDL.Tuple(SignWithEcdsaResponse),
Err: GenericSigningError
Err: EthAddressError
});
const CanisterStatusType = IDL.Variant({
stopped: IDL.Null,
Expand Down Expand Up @@ -216,25 +243,40 @@ export const idlFactory = ({ IDL }) => {
headers: IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
status_code: IDL.Nat16
});
bitdivine marked this conversation as resolved.
Show resolved Hide resolved
const SignRequest = IDL.Record({
to: IDL.Text,
gas: IDL.Nat,
value: IDL.Nat,
max_priority_fee_per_gas: IDL.Nat,
data: IDL.Opt(IDL.Text),
max_fee_per_gas: IDL.Nat,
chain_id: IDL.Nat,
nonce: IDL.Nat
});
return IDL.Service({
btc_caller_address: IDL.Func([GetAddressRequest, IDL.Opt(PaymentType)], [Result], []),
btc_caller_balance: IDL.Func([GetAddressRequest, IDL.Opt(PaymentType)], [Result_1], []),
btc_caller_send: IDL.Func([SendBtcRequest, IDL.Opt(PaymentType)], [Result_2], []),
caller_eth_address: IDL.Func([], [IDL.Text], []),
config: IDL.Func([], [Config]),
eth_address: IDL.Func([EthAddressRequest, IDL.Opt(PaymentType)], [Result_3], []),
eth_address_of: IDL.Func([IDL.Principal], [IDL.Text], []),
eth_address_of_caller: IDL.Func([IDL.Opt(PaymentType)], [Result_3], []),
eth_address_of_principal: IDL.Func([IDL.Principal, IDL.Opt(PaymentType)], [Result_3], []),
eth_personal_sign: IDL.Func([IDL.Text, IDL.Opt(PaymentType)], [Result_3], []),
eth_sign_transaction: IDL.Func([SignRequest, IDL.Opt(PaymentType)], [Result_3], []),
eth_personal_sign: IDL.Func([EthPersonalSignRequest, IDL.Opt(PaymentType)], [Result_4], []),
eth_sign_prehash: IDL.Func([EthSignPrehashRequest, IDL.Opt(PaymentType)], [Result_5], []),
eth_sign_transaction: IDL.Func(
[EthSignTransactionRequest, IDL.Opt(PaymentType)],
[Result_5],
[]
),
generic_caller_ecdsa_public_key: IDL.Func(
[EcdsaPublicKeyArgument, IDL.Opt(PaymentType)],
[Result_4],
[Result_6],
[]
),
generic_sign_with_ecdsa: IDL.Func(
[IDL.Opt(PaymentType), SignWithEcdsaArgument],
[Result_5],
[Result_7],
[]
),
get_canister_status: IDL.Func([], [CanisterStatusResultV2], []),
Expand Down
Loading